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

Share this post:

About Pat

I'm an I.T. systems engineer by day and in my spare time I code. I've made WordPress websites and plugins, weewx extensions and static html sites using Jekyll. I'm a technologist at heart and I enjoy tinkering on many different technology projects. Here on my site you will find some of the projects I've worked on, and other random bits of knowledge that I hope help someone along the way.

mentions