Hello team:
My original promtail.yaml file is currently tailored to parse 5 (five) pieces of information in each log message in order to generate their associated labels for Loki. I do this in the “scrape-configs” section using the “pipeline_stages/regex” facility.
I was asked to detect a new, 6th piece of information in the messages in order to generate its corresponding label. I modified the regex expression but promtail fails to restart :o(
I am pretty sure that the modified regex expression is syntactically correct (in fact; I checked it with success in a regex validator tool).
Is there any limit regarding the pieces of information I can parse within a log?
Your hints will be greatly appreciated
Best regards
I attached two images. One is the working (former) configuration. The other is the one that tries to detect a 6th field and associate its corresponding label.
Tony;
I followed your advice and found something. I ran the following command and I got the following error:
root@12b83a03e520:/etc/promtail# promtail -config.file=docker-config.yaml -check-syntax Unable to parse config: docker-config.yaml: yaml: line 46: found character that cannot start any token. Use -config.expand-env=true flag if you want to expand environment variables in your config file
Line 46 is the definition of my new label, called “model”. It is the last line in my YAML. I will see if I can dig into this error message.
I used tabs between the left margin in my new label. It seems that promtail´s YAML does not accepts tabs!! As soon as I replaced the tabs with as many space characters as needed, the problem dissapeared.
Like the song says: “… everybody plays the fool sometimes…”
I found TONs of people that got into this issue. It is funny to see the following thread of comments to feel better and realize I am not the only fool in the earth