-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
promtail: relabel_configs does not transform the filename label #3806
Comments
Am I right in thinking that a pipeline is run once per logged line, while relabel mapping happens once per configuration load? |
Yes, you are. This was clarified at more-or-less related issue at #3812 (comment) and #3813 (comment). |
I guess this can be closed!. Feel free to re-open if its still an issue! |
I have encountered a similar situation (Promtail 2.4.1) and cannot understand why the config below is not working (label "namespc" is not being created): scrape_configs:
- job_name: system
pipeline_stages:
- docker: {}
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/**/*.log
relabel_configs:
- action: replace
source_labels:
- filename
regex: /var/log/pods/([0-9a-z-]+?)_
target_label: namespc The explanation in #3812 (comment) did not make much sense to me as I'm not removing any label, I'm trying to extract part of log filename and convert it into a new label. Does anyone care to explain what's incorrect in my config? |
This comment should be helpful @victor-sudakov Link |
Describe the bug
relabel_configs
does not transform thefilename
label.To Reproduce
Steps to reproduce the behavior:
Expected behavior
expected the
filename
to be transformed from, e.g.,/host/var/log/kmsg.log
to/var/log/kmsg.log
.Screenshots, Promtail config, or terminal output
Alternative
I can workaround this by using a
pipeline_stages
, butrelabel_configs
should have worked.here's the workaround:
PS
This seems related to #775, which I didn't understood why it was closed.
The text was updated successfully, but these errors were encountered: