grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.49k stars 3.4k forks source link

Loki does not support comparison of two labels in a query #6737

Open mks27 opened 2 years ago

mks27 commented 2 years ago

Describe the bug Loki does not support comparison of two labels in a query

I have two label in Loki like -- label1, label2 is it possible to write a query comparing these two labels to check if they have same value or not? like this -- count_over_time({log_type="demo_logs", label1=label2}) it is not supported currently. can we include this feature in upcoming releases?

DylanGuedes commented 2 years ago

you mean like count_over_time({log_type="demo_logs"} |= label1=label2?

mks27 commented 2 years ago

no, not like this, I want like this -> count_over_time({log_type="demo_logs", label1=label2})

I want to compare it inside curly braces to get the data where both label1 and label2 have same value.