• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2308
  • Last Modified:

How Do I Automate A Log Parser Script

I have a Log Parser 2.2 script which pulls event log data from remote servers and loads the data onto the local machine in a CSV file. I would like to automate the process of pulling the event logs from the remote server to my local machine. I have tried to automate the script through a .bat file. Any help would be much appreciated!
Here is what one of my current scripts looks like:
@echo OFF
"C:\Program Files\Log Parser 2.2\LogParser.exe" LogParser -o:CSV "SELECT EventLog, EventTypeName, TimeGenerated, TimeWritten, EventCategory, SourceName, ComputerName, EventID  INTO Finance_App_Log.csv FROM \\SERVER\Application"
EXIT
0
D-bass
Asked:
D-bass
  • 2
  • 2
1 Solution
 
The_KirschiCommented:
Hi D-bass,

try it this way:

@echo OFF
"C:\Program Files\Log Parser 2.2\LogParser.exe" -i:EVT "SELECT EventLog, EventTypeName, TimeGenerated, TimeWritten, EventCategory, SourceName, ComputerName, EventID  FROM \\SERVER\Application" -o:CSV >> Finance_App_Log.csv "
EXIT

Hope this helps
Daniel
0
 
D-bassAuthor Commented:
Daniel.

I tried your modified script and it only populates the csv file with a list of log parser commands. I figured it was something with the syntax. I have played around with the new script some more but still cannot get the csv file populated with the event logs.

Any suggestions?
0
 
The_KirschiCommented:
Ok, please take this one and try again (just removed the double quote at the end). It works very well on my machine:


@echo OFF
"C:\Program Files\Log Parser 2.2\LogParser.exe" -i:EVT "SELECT EventLog, EventTypeName, TimeGenerated, TimeWritten, EventCategory, SourceName, ComputerName, EventID  FROM \\SERVER\Application" -o:CSV >> Finance_App_Log.csv
EXIT
0
 
D-bassAuthor Commented:
Daniel,

The script worked beautifully. Thanks for your help!
0
 
Skibo187Commented:
Can it be done to were it does not show the Statistics: at the bottom?
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now