Tag Archives: gz

Unix – how to search for a string in multiple gzip compressed files

Sometimes you need to look for specific errors in the log files of a couple of nodes. Luckily – for me – the system administrators have done a nice job gathering all the log files on one machine. Each node has its own folder (named after its IP address) and the logs are compressed (gunzip).

Now let’s look for a call to the “getSomeInformation” method made by the merchant 123 that should hopefully have reached one of the nodes. I will use zcat and cross my fingers…

zcat 10.1.*.*/application-a/http-requests-log.gz | grep 'getSomeInformation&merchant=123'