Hi, I'm having a lot of issues trying to figure out how to filter out log lines before they are indexed. After failing using "exclude_lines" for a couple of times, I quickly moved to the use of processors.
The main constraint I have is that I am using Saltstack to apply the configuration and therefore I'm trying to use as few nested clauses as possible. Here's the code I'm using:
I believe the issue might be in taking too much advantage of the YAML format and joining all commands, but I need some reassurance and hopefully some other ideas.
Thanks in advance.
I think the problem is in how Filebeat processes the log lines. For most modules, including the apache one, the parsing is done in ingest pipelines. These pipelines are executed when the events are received in Elasticsearch. When processors are executed, the module-specific fields (like http.response.code) don't exist yet in the event.
If you want to drop messages using filebeat processors you need to do it based on the content of the raw log line, something like what you are doing with the messages containing lxc-container-default-with-nfs.
I understand the problem with the ingestpipelines, and makes plenty of sense droping events based on the raw log lines. The processor with [quote="Jose_E, post:1, topic:215711"]
lxc-container-default-with-nfs [/quote] didn't work either though. So based on what you just told me I assume something like:
Hello, I'm new with filebeat and I'm in trouble adding a processor to the haproxy module.
To begin, just adding a tag would be enough, I tried with this config without much luck (Filebeat 7.1.1 on Debian stretch):
/etc/filebeat/modules.d/haproxy.yml
- module: haproxy
# All logs
log:
enabled: true
# Set which input to use between syslog (default) or file.
#var.input:
var.input: "file"
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/var/log/haproxy.log"]
processors:
- add_tags:
tags: [test]
The processor is NOT working. If sat globally on /etc/filebeat/filebeat.yml it works.
Any help would be very appreciated. Many thanks.
Hey there, sorry to bring this back up. But apparently ever since I made these changes, filebeat simply stoped sending module events... I just found out about it. I'm sure it is related to the processors thingy, any idea why?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.