I've been playing with Log Parser the past few days, we're trying to retain specific event IDs from the security logs of our Domain Controllers. As these are high traffic volume logs, the data in them tends to not persist more than between 15 and 30 minutes. Therefore, I need to run this query every 10 minutes or so as a scheduled task to make sure I don't lose any data.
I've (finally!) managed to get a query going that pulls the relevant data from the logs with the relevant event IDs, and write it to a SQL database. The problem I'm having is that the select statement fails with an "unknown field" error if I try to pull the EventRecordID property (which I can see in the XML for any event).
It does generate a RecordNumber; however, this number appears to relate to the query, not the event record itself. This means that I have a unique record number for each event every time I run the query, so if an event is still in the logs over multiple consecutive runs, it gets written to the database multiple times.
How can I get this to record only one instance of the vent in the database?