What is the best way to access numeric keys in the form of 150=6 or 150=8 from LogQL? It shows up properly in Parsed Fields but I am having difficulties using it in a query.
I only got it working by string matching |= “150=6” etc. but was hoping there might be another (better) way …
You can use functionality in Loki 2.0 to do this, you would need to parse the value out of the log line using one of the parser stages (regex, logfmt, json) but after this you can do stuff like:
{app="foo"} | regexp "(?P<number> some_regex_which_matches_the_number)" | number > 10