Hi,
I am trying to use logparser to monitor avg transaction times and transaction counts using a windows service but i get different results when running the queries from the command line and from my service. For example:
Running from the command line:
logparser "SELECT Count(*) FROM C:\WINDOWS\system32\LogFiles\W3SVC2\ex081001.log WHERE SUB(TO_INT(TO_TIME(SYSTEM_TIMESTAMP())),TO_INT(TO_TIME(time))) <= 300
gives me this output:
COUNT(ALL *)
------------
18
Statistics:
-----------
Elements processed: 62
Elements output: 1
Execution time: 0.00 seconds
Running from my service the following code:
string query = "SELECT Count(*) FROM " + FilePath + " WHERE SUB(TO_INT(TO_TIME(SYSTEM_TIMESTAMP())),TO_INT(TO_TIME(time))) <= 300";
LogQueryClassClass oLogQuery = new LogQueryClassClass();
COMIISW3CInputContextClassClass format = new COMIISW3CInputContextClassClass();
COMNativeOutputContextClassClass outformat = new COMNativeOutputContextClassClass();
oLogQuery.ExecuteBatch(query, format, outformat);
gives me this output:
COUNT(ALL *)
------------
62
It looks like for some reason it spits out the elements processed instead of the result of the query..
Any ideas? All help is greatly appreciated.