Hello -
I'm attempting to do some date/time matching on a CSV file, and am thinking I'm missing something fundamental with how logparser handles dates/times and comparisons.
Here's a snippet of my CSV file -
URL | VisitTime | HOUR | UserProfile |
www.ebay.com | 2015-05-13 8:58 | 8 | user1 |
www.amazon.com | 2015-05-13 8:58 | 8 | user2 |
Basically, it's a log of the internet history pulled from various PC's on my network.
I'm trying to do some charts based on days/hours/etc relative to today's time.
I've managed to do some grouping/ordering by the day -
logparser "SELECT to_timestamp(extract_prefix(to_string(VisitTime, 'yyyy-M-dd'), 0, ' '), 'yyyy-M-dd') AS DAY, COUNT(*) AS DailyHits INTO HITSDAILY-ALL.JPG FROM ALLHISTORY1.csv GROUP BY DAY ORDER BY DAY" -i:CSV -o:CHART -chartType:ColumnClustered -chartTitle:"Daily Page Hits - Last 7 Days" -groupSize:"1024x768" -q:ON
What I'm not figuring out is how to for example, pull everything from today, yesterday, this hour, last hour, and I have been through so many examples of IIS log querying by the hour that I think I have them memorized. I can't seem to get anything to work.
I'm not sure if it's my date formatting, or my understanding of the TIMESTAMP type, but I'm stuck.
Can I have an example of how to query based on the system_timestamp(), using my dataset?
Thank you everyone.