grafana / lezer-logql

LogQL lezer grammar
Apache License 2.0
3 stars 4 forks source link

Missing support on some label filter functionality. #45

Open gwdawson opened 1 year ago

gwdawson commented 1 year ago

Three points where missed when implementing the logql formatter, these are:


Example for LabelFilter !and And LabelFilter:

QUERY:
{source="data"} | logfmt | labelA="" and labelB=""

EXPECTED:
{source="data"}
  | logfmt
  | labelA="" and labelB=""

ACTUAL:
{source="data"}
  | logfmt
   | labelA="" | labelB=""

Example for LabelFilter !or Or LabelFilter:

QUERY:
{source="data"} | logfmt | labelA="" or labelB=""

EXPECTED:
{source="data"}
  | logfmt
  | labelA="" or labelB=""

ACTUAL:
{source="data"}
  | logfmt
   | labelA="" | labelB=""

Example for LabelFilter !and "," LabelFilter:

QUERY:
{source="data"} | logfmt | labelA="", labelB=""

EXPECTED:
{source="data"}
  | logfmt
  | labelA="", labelB=""

ACTUAL:
{source="data"}
  | logfmt
   | labelA="" | labelB=""