Install systemd on Filebeat Docker images#44056
Conversation
The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images
ff2a227 to
1317cd2
Compare
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
kilfoyle
left a comment
There was a problem hiding this comment.
LGTM for the docs! 🏎️
(I added just a small suggestion.)
| ```sh | ||
| docker run --rm -it --entrypoint "journalctl" docker.elastic.co/beats/filebeat-wolfi:<VERSION> --version | ||
| ``` |
Thanks Lee! |
|
@Mergifyio backport 8.17 8.18 8.19 9.0 |
✅ Backports have been createdDetails
|
The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c) # Conflicts: # docs/reference/filebeat/filebeat-input-journald.md # docs/release-notes/index.md
The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c) # Conflicts: # docs/reference/filebeat/filebeat-input-journald.md # docs/release-notes/index.md
The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c) # Conflicts: # docs/reference/filebeat/filebeat-input-journald.md # docs/release-notes/index.md
The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c)
…4085) The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c) # Conflicts: # docs/reference/filebeat/filebeat-input-journald.md # docs/release-notes/index.md * Convert the docs and changelog to markdown --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
…4086) The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c) # Conflicts: # docs/reference/filebeat/filebeat-input-journald.md # docs/release-notes/index.md * Convert the docs and changelog to markdown --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
…4087) The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c) # Conflicts: # docs/reference/filebeat/filebeat-input-journald.md # docs/release-notes/index.md * Convert the docs and changelog to markdown --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
The journald input from Filebeat requires the `journalctl` binary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container images (cherry picked from commit 32ecb7c) Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
|
@belimawr could you document the image size increase in the description of this PR? |
| {{- if (contains .from "ubi") }} | ||
| RUN for iter in {1..10}; do \ | ||
| microdnf -y update && \ | ||
| microdnf -y install systemd && \ |
There was a problem hiding this comment.
What systemd version does this install and how compatible is it with debian?
I ask because I expect users will frequently use this to read journald logs from debian or ubuntu based k8s nodes so if it isn't compatible we need to clearly document that.
There was a problem hiding this comment.
UBI at least already exposes us to CVEs in the rest of the OS packages so it doesn't have the same concerns as Wolfi for that problem.
There was a problem hiding this comment.
What systemd version does this install and how compatible is it with debian?
I ask because I expect users will frequently use this to read journald logs from debian or ubuntu based k8s nodes so if it isn't compatible we need to clearly document that.
Is not it sufficiently documented here? https://github.com/elastic/beats/pull/44056/files#diff-7a8b715909f505c1dc033e00d9fb48d50576d9c128e1c50538fe697218b97ff7R11-R21
There was a problem hiding this comment.
I think almost, that doesn't explain why this is important or what the compatibility rules are. It just says users should check.
What is journactl's version compatibility policy? Backwards compatibility (new versions can read old versions) I assume, but does it also provide forward compatibility (old versions can read new versions of journal files)?
If the Filebeat version is 255 but the host system is 257 what does that mean for users?
| {{- if (contains .from "wolfi") }} | ||
| RUN for iter in {1..10}; do \ | ||
| apk update && \ | ||
| apk add --no-interactive --no-progress --no-cache systemd && \ |
There was a problem hiding this comment.
This is going to have the side effect of exposing us to CVEs in the entirety of systemd which might turn out to be a significant problem. We probably want to keep this out of the wolfi image whose point is to minimize exposure to OS based CVEs.
In general it would actually be better to build only what we need or find a way to include just journalctl and nothing else but I'm not sure how possible that is.
|
PR to remove systemd from Wolfi #44108 |
Proposed commit message
The journald input from Filebeat requires the
journalctlbinary to ingest journal logs, this commit adds it by installing systemd in all Filebeat Docker container imagesChecklist
I have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.## Disruptive User Impact## Author's ChecklistHow to test this PR locally
Package Filebeat
DEV=true SNAPSHOT=true PACKAGES="docker" PLATFORMS=linux/amd64 mage -v packageEnsure
journalctlis present in the containers (adjust the image name/tag according to the version you built, oss or not)Start a stack. E.g: using elastic-package:
elastic-package stack up --version=9.1.0-SNAPSHOT -v -dCreate the following
filebeat.yml(adjust the IP address/ES host as needed)filebeat.yml
Then run Filebeat from the docker image (adjust the journald folder if needed)
Ensure there are no errors and data is ingested
Related issues
journalctlto Filebeat and Elastic-Agent docker images #44040## Use cases## Screenshots## Logs