Wednesday, February 6, 2013

Get a column from output and then get unique values

log example :

[02/06 06:20:01:664] [Thread-0] [ExtractJob][INFO]: ExtractJob execute started.
[02/06 06:20:01:666] [Thread-0] [Extracter][INFO]: send request for: Universe=RVUS0; ...
[02/06 06:20:04:135] [Thread-0] [Extracter][INFO]: request failed for 20130206 ....
[02/06 06:20:04:135] [Thread-0] [Extracter][INFO]: send request for: Universe=RVUS0; we....
[02/06 06:20:23:593] [Thread-0] [Extracter][INFO]: Extracting file: 36827dba-e66f-444a-b730-7.csv



print events times rounded to minutes:

[user@server ~]$ grep "ERROR" /www/logs/my.app.log | cut -d ':' -f 1,2,3 | sort | uniq

[02/06 06:20:01
[02/06 06:20:04
[02/06 06:20:23
[02/06 06:20:24

No comments:

Post a Comment