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

Mapping Input variables to Loki output plugin labels #9923

Open
webgps opened this issue Feb 6, 2025 — with Slack · 0 comments
Open

Mapping Input variables to Loki output plugin labels #9923

webgps opened this issue Feb 6, 2025 — with Slack · 0 comments

Comments

Copy link

webgps commented Feb 6, 2025

Need some help here.
I'm trying to set labels on loki output from multiple input like this:

           [INPUT]
                  Name          tail
                  Tag           system.syslog
                  Path          /var/log/syslog
                  Parser        syslog-rfc5424
                  DB            /var/log/flb_syslog.db
                  Mem_Buf_Limit 5MB

              [INPUT]
                  Name          tail
                  Tag           system.audit
                  Path          /var/log/audit/*.log
                  Parser        syslog-rfc3164
                  DB            /var/log/flb_audit.db
                  Mem_Buf_Limit 5MB
                  Skip_Long_Lines On

.
.
etc..

what I want to achieve is that label service_name can be selected in Grafana as label an returns the value regarding to INPUT Tag or any other flag, for example (Tag):

system.syslog
system.audit
             [OUTPUT]
                  Name          loki
                  Match         *
                  Host          loki
                  Port          3100
                  Labels        environment=prod,hostname=${HOSTNAME},service_name=$Tag

I don't know if its even possible to map theese dinamically to labels

Slack Message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant