Using grep on live active log files

February 20, 2017 by Pat - Comments - - 1 min read

O'Brien LabsI had a need recently to where I needed to grep an Apache httpd log file to see if a certain web subfolder was accessed. I wanted to grep the access log file which has historical and live data coming into it, and found this to be a great solution. Sharing it here in case it helps someone in the future!

In this example, dd87946d06c23e was the name of the folder I was looking to see was accessed.

tail -f -n 5000 /var/log/httpd/access_log | grep --line-buffered dd87946d06c23e

Disclosure: Some of the links on this website are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase.
Share this post: