I have nginx log file, and I want to find out market share for each major version of browsers. I am not interested in minor versions and operating systems. I would like to get something like this:
100 IE6
99 IE7
20 IE8
200 FF2
300 FF3
I know how to get the list of user agents from the file, but I want to aggregate the list to see only the major versions of the browsers. Is there a tool that does it?
Best Answer
awk(1)
- selecting full User-Agent string of GET requestscut(1)
- using first word from itsort(1)
- sortinguniq(1)
- countsort(1)
- sorting by count, reversedPS. Of course it can be replaced by one
awk
/sed
/perl
/python
/etc script. I just wanted to show how rich unix-way is.