Im trying to extract subject as label from mailbox file.
Whatever the order between regex and multiline, i never succeed to extract the subject or at least to send it to loki from promtail
I checked regex on regexp101 with go regexp and it’s working fine.
sorry it’s me i did not write here with ending quite.
So whatever the char used simple or double quote, it’s not working.
Without any quotes promtail is failing to start
The reason why your “subject” label is always showing “subject” is because you’ve put it in static_configs. You should move that labels stage into pipeline_stages after the regex stage.
well you ask me to put it into the pipeline_stage, so i assume you know exactly the syntax and the semantic of it. Could you provide a solution based on my peace of conf in the first post. thank
Well in fact it’s not working as expected, when the message is short enough, subject is sent to loki. But when the message is long enough it goes through multiline and the subject is not sent.