Hi All.
i have this working into a text file, however i now want to take yesterdays events into a html file using tpl template. I have an example template i have modified to contain my fields,
this is all taken from a script already present at this company to export the logs to txt file
I do the following cmd were CSDC01 is a servername
call C:\Daily-Checks\_chklogsnp1.bat CSDC01
_chklogsnp1.bat contains
"c:\program files\log parser 2.2\LogParser" -i:EVT -o:TPL –tpl:applog.txt "SELECT ComputerName, TimeGenerated, EventLog, EventID, EventTypeName, SourceName, Message INTO %1-applog.htm FROM \\%1\Application WHERE TimeGenerated >= TO_LOCALTIME ( SUB(SYSTEM_TIMESTAMP(), TIMESTAMP('3', 'd') ) ) AND ((EventTypeName = 'Warning event') OR (EventTypeName = 'Error event'))"
%1 is the server name pased in as a variable
Error: detected extra argument "SELECT ComputerName, TimeGenerated, EventLog, Ev
entID, EventTypeName, SourceName, Message INTO CSDC01-applog.htm FROM \\CSDC0
1\Application WHERE TimeGenerated >= TO_LOCALTIME ( SUB(SYSTEM_TIMESTAMP(), TIME
STAMP('3', 'd') ) ) AND ((EventTypeName = 'Warning event') OR (EventTypeName = '
Error event'))" after query
if i modify it back to pump the output to a text file it works fine
my template is this applog.txt shown below
<LPHEADER>
<HTML>
<HEAD><TITLE> %FIELDNAME_1% application Report</TITLE></HEAD>
<BODY>
<H1>%FIELDNAME_1% Application Log Report</H1>
<TABLE BGCOLOR="#D0D0E0" BORDER="1" CELLPADDING="10">
<TR>
<TH>%FIELDNAME_1%</TH>
<TH>%FIELDNAME_2%</TH>
<TH>%FIELDNAME_3%</TH>
<TH>%FIELDNAME_4%</TH>
<TH>%FIELDNAME_5%</TH>
<TH>%FIELDNAME_6%</TH>
<TH>%FIELDNAME_7%</TH>
</TR>
</LPHEADER>
<LPBODY>
<TR>
<TD><TT>%FIELD_1%</TT></TD>
<TD><TT>%FIELD_2%</TT></TD>
<TD><TT>%FIELD_3%</TT></TD>
<TD><TT>%FIELD_4%</TT></TD>
<TD><TT>%FIELD_5%</TT></TD>
<TD><TT>%FIELD_6%</TT></TD>
<TD><TT>%FIELD_7%</TT></TD>
</TR>
</LPBODY>
This is doing me in so any help is greatly appreciated as this is my first attempt with ms log parser 