Answer» I'm running windows 2003 Server (Enterprise)...I'm not a software guy...I'm more of a Hardware guy. Anyway, basically what I'm wanting to do is run a BAT (or something) to search my Event Viewer Logs for new content "within the last 7 days." I don't want to have to put a date in. When it finds the new content, I want to have the new content exported to a TXT file on a mapped network drive. When this is created, I'll be putting it in the TASK Scheduler to run on a scheduled basis.
Any ideas??
thanks,
jI'm not a batch file guru I'm afraid, but I do KNOW that you'll find this tool very helpful: >Microsoft's Log Parser< and >The Unofficial Log Parser Support Site<.This seems like it cold be a very good tool! I'm trying to figure out the syntax though... below is basically one of the variations I've been trying, but it hasn't seemed to work yet.....can you take a look at it and tell me your thoughts?
C:\Program Files\Log Parser 2.2>logparser "select* FROM System INTO c:\temp\test 1.csv Where TimeGenerated >= TO_LOCALTIME ( SUB( SYSTEM_TIMESTAMP(), TIMESTAMP( '7', 'd' ) ) )The SQL statement needs to be in inverted commas "...". And that > before logparser, would NEED to be a \, of course. The time/date functions leave a little to be desired. Experimentation is necessary! Use the GUI output initially (see the examples in the online help), and tweak one thing at a time - that's my best advice.
I currently use this tool to assist in an automated dump of the event logs of a fleet of servers into a MySQL database for further analysis (for a local ISP).
|