Bobby's Blog

Bash script which will summarize your access logs and check what caused the spike on your server

Access logs bash script

Summarizing your access logs

More often than not you would need to go though your access logs. I personally have to do that quite often in order to determine what has caused the CPU spike on my server or to figure out if anything malicious is going on.

Sometimes reading the logs could be quite intimidating as the log might be huge and going though it manually could take a lot of time. Also the raw log format could be confusing for people with less experience.

Here’s a cool short bash script which would summarize the whole access log for you without the need of installing any additional software. You can run it on any Linux server without root or sudo access. All you need is the access log itself and a terminal.

Download the script from this Github repo:

How do I run the script?

All you have to do is to download the short bash script, make it executable and run it.

The output that you would see should look something like this:

That’s pretty much it 🙂

If you notice any issues please give me a poke so I could try and patch them.


About the author

Bobby

Linux System Administrator