The simplest tools to use are the venerable command-line file processing utilities that come with most GNU/Linux systems. Here is an example of finding all the unique URL registration events in a log file:
$ grep register dendnet.log | awk '{print $4, $5 }' | sort | uniqIf we break it down it works like this:
1fvuqxgdentxqnnpc0071hq45 u'https://github.com/PhoenixBureau/DendNet'
1p9d4ew8a7mf2gpabrdqhtgdh u'http://openkeyval.org/'
d2i04eshhhg10lz6szytitcsh u'http://www.phoenixbureau.org/'
grep register dendnet.logThat command finds all the lines in the log for URL registration events.
awk '{print $4, $5 }'This prints out each line with only the tag and URL, separated by a space.
sort | uniqLast but not least, we sort the lines and remove duplicates.
No comments:
Post a Comment