Skip to content
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

Add an option to systemd_journald receiver to filter by service #1784

Open
dcfreire opened this issue Aug 23, 2024 · 3 comments
Open

Add an option to systemd_journald receiver to filter by service #1784

dcfreire opened this issue Aug 23, 2024 · 3 comments
Labels

Comments

@dcfreire
Copy link

It'd be very useful for my use case to be able to the configure systemd_journald receiver to only fetch logs from an specific service. Fluent Bit seems to have this implemented, so my guess is that this would only be a matter of exposing Systemd_Filter to the user. Something like:

  receivers:
    systemd_logs:
      type: systemd_journald
      systemd_filter:_SYSTEMD_UNIT=name.service
@jefferbrecht
Copy link
Member

jefferbrecht commented Aug 30, 2024

Hi @dcfreire, thanks for the feature request -- this sounds very reasonable. We'll open a tracker internally for it and I'll keep this issue updated once it's prioritized.

As a workaround in the meantime, are you able to use exclude_logs to filter out anything that's not from name.service? Something like this, unfortunately it's a bit more obtuse:

  receivers:
    systemd_logs:
      type: systemd_journald
  processors:
    name_service_only:
      type: exclude_logs
      match_any:
      - jsonPayload._SYSTEMD_UNIT != "name.service"
  service:
    pipelines:
      systemd:
        receivers:
        - systemd_logs
        processors:
        - name_service_only

@dcfreire
Copy link
Author

dcfreire commented Sep 11, 2024

Sorry for taking a while to reply, but yes I am, and I did :).
I was going to open a PR myself, but then I saw this comment by the author of the PR that implemented the systemd logging receiver that made it seem that this was a design choice, rather than something they overlooked.

Copy link

This issue was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants