0

I need to collect current data from the nginx access.log every minute to monitor amount of requests and errors. It's nginx's frontend log - with a lot of requests. It's formatted, rotated, then archived every hour.

So — requests per minute and various errors per minute — how to parse that I know — but how to get 1 minute worth of logs?

I am trying to timeout 60s tail -f /var/log/veryfastmovingaccess.log >> 60s_log.tmp Then awk parses tmp, cleans it, restarts tail. Am I doing it wrong?

1 Answer 1

0

You're better off looking at a proper monitor infrastructure, but a quick-n-dirty solution for nginx may be to use ngxtop. It will probably also be a good starting point for any custom monitoring you want to do.

In response to your original question, see also this thread on Server Fault.

1
  • Got some more info into the question.
    – Dach
    Jul 8, 2015 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .