I am reading The Logstash Book and there is an example of custom Apache logging. I am sorry if this is more of an apache questions, but it is directly related to logstash. I've created the following conf file for my Ubuntu 16.04 test server:
LogFormat "{
"host":"webapp.local",
"path":"/var/log/apache2/logstash_access_log",
"tags":["wordpress","www.example.com"],
"message": "%h %l %u %t \"%r\" %>s %b",
"timestamp": "%{%Y-%m-%dT%H:%M:%S%z}t",
"clientip": "%a",
"duration": %D,
"status": %>s,
"request": "%U%q",
"urlpath": "%U",
"urlquery": "%q",
"method": "%m",
"bytes": %B,
"vhost": "%v"
}" logstash_apache_json
CustomLog /var/log/apache2/logstash_access_log logstash_apache_json
The log file is created but no content is ever created within the file from Apache. I've placed the file in /etc/apache2/conf-available. Ran a2enconf apache_log to create the symlink to /etc/apatche2/conf-enabled.
Any ideas would be helpful as I learn this new technology regarding ELK.
Thank you!