I found multiple ways how to use functions and filters on loki loglines and to build metrics based on counting those loglines. But what I want is to, for example, use the value of each size label in an nginx access log and create a metric on this.

I know, that I can use an exporter and prometheus for this and that this is the typical way to do it. But this is just an example, and when the data is already there provided by loki, can't I use it? For me it looks to me like I can just parse and search loglines using LogQL but then I cannot use the data that is within those lines.

Maybe I am just missing the functions for that? Given a LogQL expression like that:

{host="myhost", app="nginx", logtype="access"}

when using a time series panel, how can I use the value of the size label to build a metric?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.