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

Help with dates.....

$
0
0

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 - 

URLVisitTimeHOURUserProfile
www.ebay.com2015-05-13 8:588user1
www.amazon.com2015-05-13 8:588user2

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.


Viewing all articles
Browse latest Browse all 204

Latest Images

Trending Articles



Latest Images

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