I'm having some issues getting filebeat to exclude lines from apache2's access log. I've got the apache2.yml config enabled and it does exclude log files but not lines. Here's an example of the line I'm looking to exclude:
example.site.com:80 192.168.0.1 - - [20/Dec/2017:10:18:37 -0500] "GET /server-status?auto= HTTP/1.1" 301 522 "-" "Go-http-client/1.1"
Here are the ways I've tried to use the regexp format with the exclude_lines: option in the apache2.yml file:
exclude_lines: ['.*server-status.*']
exclude_lines: ['(?i:/server-status\?auto=)']
exclude_lines: ['GET /server-status']
as well as a few other variations. I've also tried a processor in both the main filebeat config file and in the apache2 module config like this:
- module: apache2
# Access logs
access:
enabled: true
processors:
- drop_event:
when:
regexp:
apache2.access.url: "server-status"
I tried it with contains:
in place of regexp:
but that doesn't seem to work either. But this:
exclude_files: [".gz$"]
DOES work; from the log file:
017-12-21T10:15:27-05:00 DBG [prospector] Exclude file: /var/log/apache2/example.site.com/access.log.10.gz
It's all been making me a little nuts. Doesn't matter which way I try the expression or processor, the example log line above is still being fed to elasticsearch. I posted a similar question over at the discuss.elastic.co forums but no one has replied thus far.
Does anyone have experience excluding log lines? Filebeat, Elasticsearch, and Logstash are all at version 6.1.0.
Thanks in advance!