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

The 'matches' parameter for the Promtail journal scraper is not documented in the config reference #9434

Open
adeverteuil opened this issue May 9, 2023 · 1 comment
Assignees
Labels
component/promtail help wanted We would love help on these issues. Please come help us! type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories

Comments

@adeverteuil
Copy link
Contributor

The Scraping page mentions a 'matches' parameter for the journal scraper.

https://grafana.com/docs/loki/latest/clients/promtail/scraping/#journal-scraping-linux-only

The matches field adds journal filters. If multiple filters are specified matching different fields, the log entries are filtered by both, if two filters apply to the same field, then they are automatically matched as alternatives.

The example shows this value is a string. It's not clear how to provide multiple filters. Are they space separated? Comma separated? Is quoting supported? Can it be a YAML list or dict?

Also, the 'matches' field is not mentioned in the Configuration reference page.
https://grafana.com/docs/loki/latest/clients/promtail/configuration/#journal

@JStickler JStickler added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label May 10, 2023
@JStickler JStickler self-assigned this May 10, 2023
@JStickler JStickler added the help wanted We would love help on these issues. Please come help us! label Aug 16, 2023
@cbu27
Copy link

cbu27 commented Aug 24, 2023

I was also confused due to the missing documentation for "matches" but i found out, that you have to provide parameters like journalctl command line arguments.

e.g. if you filter for special units

matches: _SYSTEMD_UNIT=XXX.service _SYSTEMD_UNIT=XXX.service _SYSTEMD_UNIT=XXX.service

Please note, that you have to grant access to the promtail user for the journal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/promtail help wanted We would love help on these issues. Please come help us! type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

No branches or pull requests

3 participants