2

I would like to get hourly statistics about the http status codes which were returned by the apache web server.

One solution would be to analyze the http log file.

But this is a moving target.

It gets longer during reading it, and from time to time it gets rotated.

I am unsure.

Maybe there is a more modern way to get hourly http status code statistics?

With statistics I mean: Number of status codes returned in one hour.

For example:

  • 200: 1200 times
  • 404: 200 times
  • 500: 3 times
  • ...

Please leave a comment why you down-vote this question.

guettli
  • 3,113
  • 14
  • 59
  • 110

3 Answers3

2

What you need is some log processing tool, that will handle pushing your log to some database or log server, then you can work with the data, not raw log files. These are most common log processing tools:

For example you may send your web server logs with Logstash to Elasticsearch and then analize them using Kibana. This is just one scenario.

  • Is there no other way to get statistics? It would be great to get the numbers without parsing log files. – guettli Nov 01 '17 at 16:21
  • You can feed data to Google Analytics for example, like here: https://serverfault.com/questions/236366/install-google-tracking-apache-level – Paweł Tatarczuk Nov 01 '17 at 19:26
  • yes, this could be done. I would like to have a solution which does not require a third party service like Google Analytics. – guettli Nov 02 '17 at 13:48
0

Feed it into a proper log analyis tool, e.g. graylog or something more involved like the ELK stack.

Sven
  • 97,248
  • 13
  • 177
  • 225
0

I found this https://github.com/jib/mod_statsd (but I have not used it up to now)

This module enables the sending of Statsd statistics directly from Apache, without the need for a CustomLog processor. It will send one counter and one timer per request received.

guettli
  • 3,113
  • 14
  • 59
  • 110