Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with Windows event log and CSV file

Status
Not open for further replies.

Phatxausage

IS-IT--Management
Mar 5, 2015
1
HK
Here is what I need to do.


[ol 1]
[li]There is a CSV file with 3 columns (Datasource, eventID, project Code, description)[/li]
[li]Get a time stamp from a text file[/li]
[li]Grab all application log events that is newer than the time stamp[/li]
[li]Replace the time stamp to current time[/li]
[li]For each event (with the event datasource and eventID), match the datasource and eventID against the CSV file. If a datasource and eventID are matched, write a new event with a pre-defined fixed datasource name and ID, along with the corresponding project code description into this new event description.[/li]
[/ol]

At the end system center operations manager will pick up this particular new event and generate an Alert, which associate a project code. End users/administrators can modify the CSV file themselves to enable specific event log monitoring by their own
I planned work this out using Powershell with Import-CSV and Get-EventLog. However the script has to work on 2003 servers without powershell and deploying PowerShell on them is not allowed.

As I am not really a scripting guys. I would like know at least some high level procedures to work this out.
Get the CSV into an array?
Get those event logs into another array?
standardize format?
Cross matching?
write back event log

really lost......

 
Since you seem more comfortable with Powershell than vbscript... I know very little about it, but can't powershell read a remote event log? Are you sure you need to install anything on the 2003 servers?
 
Take a look here for some samples on reading a remote event log:
Also take note that because you can read the desired data with WMI, you CAN use PowerShell to achieve your goal. PowerShell on your admin station would merely send WMI commands to the 2003. You do however need to have admin rights to read those logs and remote WMI needs to be configured on the 2003 boxes.

The only parts you are really concerned about are the WMI queries which you can easily translate to PowerShell code.

I hope that helps.

Regards,

Mark

No trees were harmed in posting this message, however a significant number of electrons were terribly inconvenienced.

Check out my scripting solutions at
Work SMARTER not HARDER.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top