Open kvch opened 2 years ago
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)
I've updated the list of integrations using the logfile
input type based on usage as of today.
Hi! We just realized that we haven't looked into this issue in a while. We're sorry! We're labeling this issue as Stale
to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1
. Thank you for your contribution!
Please make sure this is available in the custom logs integration
scan_frequency ignore_older close_inactive harvester_limit prospector.scanner.include_files
Goal
The goal of this issue is to migrate existing packages that rely on
log
(logfile
) input tofilestream
. Updating the package must be backwards compatible. The change in the integration package should be hidden from users.The only user-visible change should be the value of
input.type
in the event fromlog
tofilestream
.Why migrate?
The new
filestream
input has replaced the good, oldlog
a.k.a.logfile
input in Beats. The filestream input is GA since 7.16 and at the same timelogfile
was deprecated. In the last few releases, we added numerous bug fixes to the new input, and now we are working on enhancements. It is stable enough for adoption in Integrations.It comes with several improvements over the old input: https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#filebeat-input-filestream
Differences
There are several differences in the configuration of the inputs:
close.*
optionsparsers
list instead of top-leveljson.*
andmultiline.*
settingsscanner
options: excluding files, scan interval settingHow to migrate integrations?
Some of the changes might be automated, for example, renaming
close_removed
toclose.on_state_change.removed
. But some options require manual checking and adjustments e.g. the parsing of lines. Also, there are new options, likeinclude_files
the counterpart ofexclude_files
. Those should be validated to see if existing configurations could be improved.General steps for migrating a package
exclude_files
->prospector.scanner.exclude_files
recursive_glob
->prospector.scanner.recursive_glob
symlinks
->prospector.scanner.symlinks
scan_interval
->prospector.scanner.interval
close_inactive
->close.on_state_change.inactive
close_renamed
->close.on_state_change.renamed
close_removed
->close.on_state_change.removed
close_eof
->close.reader.eof
close_timeout
->close.reader.after_interval
harvester_buffer_size
->buffer_size
max_bytes
->message_max_bytes
parsers
optionjson
is renamed tondjson
container
is preferred overcontainer
inputprospector.scanner.include_files
How to migrate on Filebeat side?
If someone has been using e.g. Apache integrations and updates to the new version, input change must not be visible to users. Upgrading the package must not mean that the monitored files are read from the beginning. State information from the
log
input has to be passed to thefilestream
input, so it can continue where log input has left off. Given that position tracking is similar in the inputs, changing the state ID fromlog::{id}::{device}-{inode}
tofilestream::{id}::{device}-{inode}
should work.Tasks
Beats side migration
log
input fromfilestream
inputPackages
This is the list of packages that use
logfile
input to collect data.