Created
May 15, 2023 13:33
-
-
Save xakrume/540ed34b4b24642d46c372b91d68d943 to your computer and use it in GitHub Desktop.
medium:promtail.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline_stages: | |
- logfmt: | |
mapping: | |
timestamp: time | |
level: | |
- match: | |
... | |
- match: | |
selector: '{job="exporters"}' | |
stages: | |
- regex: | |
source: service | |
expression: .+-(?P<environment>(stable|testing|unstable)$) | |
- labels: | |
environment: | |
- template: | |
source: environment | |
template: '{% raw %}{{ if .Value }}{{ .Value }}{{ else }}default{{ end }}{% endraw %}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment