Shell command of the day

[gist id=”0cee35d51ca1a791d532a7dc1ab3cbf6″]
This command will look for the ID value XXXXX in your log files ending in either *.log or *.log-YYYYMMDD. It will then only return output with the preceding 20 characters, and the trailing 20 characters.
This is great for finding things quickly across a bunch of log files in varying formats to correlate production issues.

Leave a Reply

Your email address will not be published. Required fields are marked *