0

I have a bunch of apache access log files and I want to know which IP addresses visited my /contacts folder. How can I collect them from all log files with shell command?

1 Answers1

2

Just use simple grep and awk command to filter records and show IPs. For common log format you can use something like this:

cat /path/to/apache/accesslog/dir/* |grep "/contacts" |awk '{ print $1 }' |sort -u

Or there is better way - setup some central logging and analyzing tool (like ELK stack) and use it for global analyzing across time and data.

Ondra Sniper Flidr
  • 2,623
  • 11
  • 18