Logstash forwarder did a great job
Alas, it had his faults.
If you’d have push backs from your logstash server(s), the logstash forwarder would enter a frenzy mode, keeping all unreported files open (including file handlers).
If you then had a sane log rotating policy, the files would be deleted, but the forwarder would keep the file handles open, causing the disk to fill up.
There was a hidden flag called "dead time"
where you could configure how the maximum age of the files that the forwarder would keep open, but that didn’t always work either.
The only quick solution was to restart the forwarder.
As with that bug, soon all critical bug issues on the forwarder repository had the same message:
This will be fixed in the coming beats release.
I’d been waiting for some free time to upgrade our (BigPanda) logging pipeline to beats (filebeat), and finally, the opportunity represented itself.
Here’s some notes from the upgrade procedure.
Config files are now YAML
IMHO, a welcome change.
You’ll need to define another logstash input logstash-input-filebeat
Which is almost identical to the logstash-input-lumberjack
, but notice the ssl => true
which needs to be set.
The following example is the Ansible Jinja2 template we use for the filebeat logstash input:
|
|
Back to filebeats
There’s now an option to include a config_dir
!
Yay! Finally a way to do a conf.d
type solution.
Remember “dead time”?
It’s now called ignore_older
, and guess what, it’s actually honored and working!
Here’s an example of the filebeat config (again an Ansible Jinja2 template):
Notice the indentation of the output
option, which is not shown in the official docs for some reason.
|
|
In our case, we changed {{ beats_port }}
from the default 5044
port to the port used by logstash forwarder (5043
), just to simplify security groups and port openings.
And this is one of the filebeat configs loaded in the config_dir
:
|
|
Small FYI, Beats automagically adds beat.name
and beat.hostname
to the fields.
To Summarize:
- Config moved from json-ish to YAML.
- File handle locks have improved drastically
- The filebeat agent now load balances its output to all logstash servers, which spreads the load more equally between them.
- Replace
file
withsource
in your logstash filters if you grok by it.