Filter User-Agents, sort and count number of appearing

How to Filter User-Agents, sort and count number of appearing like in this tutorial using ghost production logs. file?

Can you post the proper command line, please?

You can do something like this:

cd {instance}/content/logs
../../current/node_modules/.bin/bunyan LOG_FILE | grep user-agent | sort | uniq -c

Any other solution?

What’s the issue with what I provided? You’re not going to get feedback if you don’t clarify the issue :wink:

I need to filter ghost logs to display User-Agents, that visits website.

Your solution is not working, not found bunyan etc. I need to other command that works.

What does the output of the command I gave you say?

As the original post template asked, how are you hosting ghost? My command only works if you are using the Ghost CLI

Sorry, my mistake, I config logging to different directory and there your command not working, but under content directory it works. However, my logs are on different directory. changed urls and it works.

One more thing: what to add to sort in decreasing order (from bigger to smaller amount)?

The command I gave you sorts from largest to smallest. If you want from smallest to largest, change sort to sort -r