Quantcast
Channel: General Discussion
Viewing all articles
Browse latest Browse all 204

Including dynamic variables in logparser query

$
0
0

Hi All, 

I have a logparser query as below

logparser "select TO_LOCALTIME(TO_TIMESTAMP(date, time)) as [LocalTime], sc-status as http_status, count(*) as [Count] into 'd:\logfiles\serial.txt' from \\<server name>\LogFiles\W3SVC1\u_ex1512*.log WHERE (cs-uri-stem = '/Payee*') and LocalTime > SUB(TO_LOCALTIME(SYSTEM_TIMESTAMP()), TIMESTAMP('0000-01-01 01:00', 'yyyy-MM-dd HH:mm')) and (sc-status <> "200") group by http_status, LocalTime" -i:IISW3C -o:IIS

This query i am going to include in a batch file to run for every hour and collect required stats. Currently i am using the log file name as u_ex1512*.log. So, it means, it will run for complete month all the days and generate the report for last 1 hour only. I would like to run the report day wise instead of month. so, every day i need to modify the batch file with current date. is there any way that we can include dynamic variables in logparser query? so that i will get the system date and run the command daily.

Your help is appreciated. 


Viewing all articles
Browse latest Browse all 204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>