-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix system module with both filesets enabled #41381
Fix system module with both filesets enabled #41381
Conversation
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
0765233
to
0501772
Compare
0501772
to
59b7cb6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the linter change nor the comment for the journald stdout, did you forgot to push?
This pull request is now in conflicts. Could you fix it? 🙏
|
59974d2
to
d25f496
Compare
Some CI failures seem to be unrelated:
BK link: https://buildkite.com/elastic/filebeat/builds/10493#0192bb64-7d3a-4e8a-9879-e4528b7076ab/154-388 I tried to reproduce it on Win and did not succeed. I'll just re-run, if it fails again I'll open a FlakyTest issue. |
Fix lint warnings and add Linux build tag in the files that were missing it.
Skip TestSystemLogsCanUseJournaldInput if on BuildKite and not running as root, running commands as root is also fixed.
Journald input only works on Linux because Systemd is only available for Linux, so remove any file from the journald input that are built on OSes other than Linux. All integration test helpers from system-logs input are moved to a file that is build on all platforms.
9759879
to
49e5076
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BK pipeline change looks good
The system module did not define an ID at the root of the config, that made the V2 input loader only start the first journald input it saw because they both ended up with the same identifier (type, ID and path). This is fixed by defining an ID at the root of the configuration templates. The journald input now also adds the input_id key to its loggers and a non-fatal error is now logged at debug level. The system-logs input is now marked as experimental instead of stable. Fix lint warnings by moving toJournalConfig to input_linux.go Move TestSystemLogsCanUseLogInput to a file without the linux build constraint so it can run on all OSes supported by the system integration. (cherry picked from commit b1c7478) # Conflicts: # .buildkite/filebeat/filebeat-pipeline.yml
The system module did not define an ID at the root of the config, that made the V2 input loader only start the first journald input it saw because they both ended up with the same identifier (type, ID and path). This is fixed by defining an ID at the root of the configuration templates. The journald input now also adds the input_id key to its loggers and a non-fatal error is now logged at debug level. The system-logs input is now marked as experimental instead of stable. Fix lint warnings by moving toJournalConfig to input_linux.go Move TestSystemLogsCanUseLogInput to a file without the linux build constraint so it can run on all OSes supported by the system integration. (cherry picked from commit b1c7478) # Conflicts: # .buildkite/filebeat/filebeat-pipeline.yml
…41488) Even though the System module is not using the system-logs input any more, this commit brings improvements to the Journald input and to the, currently skipped, system-logs + system module tests. Original commit message: The system module did not define an ID at the root of the config, that made the V2 input loader only start the first journald input it saw because they both ended up with the same identifier (type, ID and path). This is fixed by defining an ID at the root of the configuration templates. The journald input now also adds the input_id key to its loggers and a non-fatal error is now logged at debug level. The system-logs input is now marked as experimental instead of stable. Fix lint warnings by moving toJournalConfig to input_linux.go Move TestSystemLogsCanUseLogInput to a file without the linux build constraint so it can run on all OSes supported by the system integration. (cherry picked from commit b1c7478) # Conflicts: # .buildkite/filebeat/filebeat-pipeline.yml * Fix filebeat-pipeline.yml merge conflict * skip system-logs test --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co> Co-authored-by: Geoff Rowland <70981735+rowlandgeoff@users.noreply.github.com>
…41487) Even though the System module is not using the system-logs input any more, this commit brings improvements to the Journald input and to the, currently skipped, system-logs + system module tests. Original commit message: The system module did not define an ID at the root of the config, that made the V2 input loader only start the first journald input it saw because they both ended up with the same identifier (type, ID and path). This is fixed by defining an ID at the root of the configuration templates. The journald input now also adds the input_id key to its loggers and a non-fatal error is now logged at debug level. The system-logs input is now marked as experimental instead of stable. Fix lint warnings by moving toJournalConfig to input_linux.go Move TestSystemLogsCanUseLogInput to a file without the linux build constraint so it can run on all OSes supported by the system integration. (cherry picked from commit b1c7478) # Conflicts: # .buildkite/filebeat/filebeat-pipeline.yml * Resolve filebeat-pipeline.yml merge conflicts * skip system-logs test --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co> Co-authored-by: Geoff Rowland <70981735+rowlandgeoff@users.noreply.github.com>
Proposed commit message
The system module did not define an ID at the root of the config, that made the V2 input loader only start the first journald input it saw because they both ended up with the same identifier (type, ID and path). This is fixed by defining an ID at the root of the configuration templates.
The journald input now also adds the
input_id
key to its loggers and a non-fatal error is now logged at debug level.The system-logs input is now marked as experimental instead of stable.
Fix lint warnings by moving
toJournalConfig
toinput_linux.go
Move TestSystemLogsCanUseLogInput to a file without the
linux build constraint so it can run on all OSes supported by the
system integration.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.## Disruptive User Impact## Author's ChecklistHow to test this PR locally
Run Filebeat with the following
filebeat.yml
andmodules.d/system.yml
(adjust credentials/addresses as necessary)filebeat.yml
modules.d/system.yml
Go to Discover in Kibana, filter by
tags: from-journald
Look at
fileset.name
from the events, make sureauth
andsyslog
are thereRelated issues
## Use cases## Screenshots## Logs