Howdy. This is in reference to journalbeat 6.6.1
Currently there appears to be 2 ways to filter input.
- I can filter by explicitly listing specific journal files and/or directories in
paths
- I can use
include_matches
in order to filter to only the matching inputs.
By default I want to include everything and then pare back the stuff I don't care about so I am less likely to miss something. So I am using empty paths to use the default local journal. That gives me everything....including journalbeats
I installed via tarball and created a systemd unit to run journalbeats with the following:
ExecStart=/opt/journalbeat/current/journalbeat run -e \
--path.config /opt/journalbeat/ \
--c journalbeat.yml
Everything is working fine. However because I am running within systemd, and using the -e
flag, journalbeat itself also logs to journal. So I get a lot of messages in the journal like:
Mar 08 14:15:56 somehostname journalbeat[10995]: 2019-03-08T14:15:56.833Z INFO [input] input/input.go:133 journalbeat successfully published 1 events {"id": "2d121d9b-6458-40ef-a9b5-f642c0218916"}
Of course this was the first and obvious thing to filter out which I did using a processor:
processors:
- add_host_metadata: ~
#- add_cloud_metadata: ~
- drop_event:
when:
equals:
process.name: "journalbeat"
This works as expected and journalbeat messages no longer get sent to logstash.
However, because this processing happens after the input is accepted, journalbeat still writes out that "journalbeat successfully published 1 events"...which goes to the journal...which journal beats reads and then prints "journalbeat successfully published 1 events" due to the lack of input filtering.
I can work around this with a couple approaches:
- Don't let journalbeat's systemd unit log to journal.
- Use
include_matches
to filter the input messages to the things I want messages from.
I am guessing #1 is the best option and hopefully just dropping the -e
argument is enough. If I have problems with journalbeat I just have to go find the traditional log file to dig through.
Would be quite handy if there was an exclude_matches
filter on the inputs so I could just use journald since "that is the future" (or so they say) and exclude journalbeat at input but take everything else (to start).
Did I miss something or is this an accurate assessment? Any other thoughts or advice? Thanks!