Skip to content

[8.19](backport #44056) Install systemd on Filebeat Docker images#44087

Merged
belimawr merged 2 commits into8.19from
mergify/bp/8.19/pr-44056
Apr 25, 2025
Merged

[8.19](backport #44056) Install systemd on Filebeat Docker images#44087
belimawr merged 2 commits into8.19from
mergify/bp/8.19/pr-44056

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Apr 25, 2025

Proposed commit message

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

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

## Disruptive User Impact
## Author's Checklist

How to test this PR locally

  1. Package Filebeat

    DEV=true SNAPSHOT=true PACKAGES="docker" PLATFORMS=linux/amd64 mage -v package
  2. Ensure journalctl is present in the containers (adjust the image name/tag according to the version you built, oss or not)

    docker run --rm -it --user root --entrypoint "journalctl" docker.elastic.co/beats/filebeat-wolfi:9.1.0-SNAPSHOT --version
    docker run --rm -it --user root --entrypoint "journalctl" docker.elastic.co/beats/filebeat-ubi:9.1.0-SNAPSHOT --version
    # Only for x-pack
    docker run --rm -it --user root --entrypoint "journalctl" docker.elastic.co/beats/filebeat:9.1.0-SNAPSHOT --version
  3. Start a stack. E.g: using elastic-package: elastic-package stack up --version=9.1.0-SNAPSHOT -v -d

  4. Create the following filebeat.yml (adjust the IP address/ES host as needed)

    filebeat.yml

    filebeat.inputs:
      - type: journald
        id: foo-bar
        paths:
          - /var/log/journal/*/*.journal
    
    output.elasticsearch:
      hosts:
        - https://192.168.42.42:9200
      username: elastic
      password: changeme
      ssl.verification_mode: none

  5. Then run Filebeat from the docker image (adjust the journald folder if needed)

    docker run --rm \
      --name=filebeat \
      --user=root \
      --volume="/var/log/journal:/var/log/journal:ro" \
      --volume="$(pwd)/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro" \
      --volume="registry:/usr/share/filebeat/data:rw" \
      docker.elastic.co/beats/filebeat-wolfi:9.1.0-SNAPSHOT filebeat -e --strict.perms=false setup
  6. Ensure there are no errors and data is ingested

Related issues

## Use cases
## Screenshots
## Logs


This is an automatic backport of pull request #44056 done by [Mergify](https://mergify.com).

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
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Apr 25, 2025
@mergify mergify bot requested review from a team as code owners April 25, 2025 15:13
@mergify
Copy link
Copy Markdown
Contributor Author

mergify bot commented Apr 25, 2025

Cherry-pick of 32ecb7c has failed:

On branch mergify/bp/8.19/pr-44056
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit 32ecb7ccc.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   dev-tools/packaging/templates/docker/Dockerfile.tmpl

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   docs/reference/filebeat/filebeat-input-journald.md
	deleted by us:   docs/release-notes/index.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot requested review from AndersonQ and VihasMakwana and removed request for a team April 25, 2025 15:13
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 25, 2025
@github-actions github-actions bot added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team bugfix labels Apr 25, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 25, 2025
@belimawr belimawr merged commit ed0c083 into 8.19 Apr 25, 2025
186 of 187 checks passed
@belimawr belimawr deleted the mergify/bp/8.19/pr-44056 branch April 25, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bugfix conflicts There is a conflict in the backported pull request Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants