Ok, I like the look of the quick and easy grep version. I had to modify it slightly because it was picking up entries in earlier months which had June, Juniper, Juno somewhere on the line.
#!/bin/sh
str=0
while test "$str" != ""
do
echo -n "String to look for: "
read str
grep $str "/var/log/access_log"
done
Interactive.
You could run the other as a cron job if you just want
to prune logs, replacing the old month with the new one of course.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.