Basic question about parser pattern syntax

I’m trying to follow Log queries | Grafana Loki documentation to create my own parser pattern and I’m stuck. The line which I try to parse:

2021-09-28T06:50:55.867 harvester chia.harvester.harvester: ERROR    Error using prover object badbit or failbit after reading size 7421 at position 50005527089

For a test, I want to parse just the date and for this I’ve constructed this querry:

{job="logg"}|="WARNING" | pattern "<date>T<_>" | line_format "{{.date}}"

and the error which I encountered:

“parse error at line 1, col 35: syntax error: unexpected STRING”

I’m a little bit confused as I tried to follow documentation step by step. Any suggestions what did I wrong?

You may be past this by now, but I think your issue is in the double quotes vs backticks.

| pattern "<date>T<_>" 

should be

| pattern `<date>T<_>` 

at least for me - I ran into this trying to use single quotes.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.