PipeBug: Monitoring Using Graphite, Logstash, Sensu, and Tessera

Apache access logs to PipeBug ELK

We have couple of steps to complete before we can send the logs to ELK

Now to the action

Step 1:

Lets configure our hosts file to our logstash server. We need to edit /etc/hosts and add a record there in the following format You need to have logstash server ip from pipebug.com interface

[logstash server ip] logstash

for example it should look like this logstash

Step 2

Configure apache with right log format.

Open the follwing file


And search for LogFormat, add the follwing below:

LogFormat "%a %u [%{%Y-%m-%dT%H:%M:%S%z}t] \"%r\" %>s %B \"%{Referer}i\" \"%{User-agent}i\" %D %I . %{%s}t %k 0 %O %{Content-Length}i \"%{Content-Type}i\" \"%v\" 0 0 0 0" detailed

Step 3

Configure Apache virtual hosts to send logs to Logstash

In every virtual host you want to send his logs to ELK add the following line

CustomLog "|nc -w 1 -u logstash.server logstash.port" detailed

Step 4

All configuration files are in place all we need to do now is to reload apache configuration

Reload apache

/etc/init.d/apache2 reload

Elasticsearch, Kibana, Logstash and Grafana are trademarks of the Elasticsearch BV.
Nagios is a trademark of the Nagios Enterprises.
Sensu is a trademark of the Heavy Water Operations.
Pagerduty is a trademark of the PagerDuty Inc.