What command would i use to parse a server log to get all hits received on a specific date and the number of uniques the same day?
Thanks
hyperbole
12:33 am on Mar 3, 2004 (gmt 0)
Doesn't that kinda depend on how your logs are organized? And which operating system you using?
DaScribbler
2:34 pm on Mar 3, 2004 (gmt 0)
grep by date sort it to get each reoccurance adjacent in the list uniq the list then wc to count them (use the -l option so only lines are counted) if the log contains anything other than hits, pass it through another grep containing a string denoting a hit from an incoming server.
grep '<date>' <logfile> ¦ sort ¦ uniq ¦ wc -l
to get All hits for the day, just grep and wc
DaScribbler
10:33 pm on Mar 3, 2004 (gmt 0)
whups...almost forgot, make sure the sort is on a field that will place similar hits together (ie...whichever field the servernames are on, or IP's etc) otherwise the sort will be based on time and date, resulting in the uniq command not noticing the duplicate entries.