mirror of https://github.com/grafana/loki
[Fix] OR statements not being evaluated as part of nested line filters (#11735)
**What this PR does / why we need it**:
When nester line filters were being evaluated, the `OR` statements in
right expressions were omitted and only `LineFilters` were returned.
Resulting in only first value being returned.
It can be reproduced in stringer unit test failing with,
```
Error Trace: /Users/poyzannur/workspace/loki/pkg/logql/syntax/ast_test.go:535
Error: Not equal:
expected: "{app=\"foo\"} |= \"foo\" or \"bar\" |= \"baz\" or \"bal\""
actual : "{app=\"foo\"} |= \"foo\" or \"bar\" |= \"baz\""
```
We now return the `OR` expression as part of nested line filters. Thanks
a million to @ashwanthgoli for help with debugging, and extra unit test.
**Which issue(s) this PR fixes**:
Fixes https://github.com/grafana/support-escalations/issues/9042
**Special notes for your reviewer**:
**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [x] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e3ec)
- [ ] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory.
[Example
PR](0d4416a4b0)
pull/11747/head^2
parent
e625d7f1ca
commit
6d66ea382c
Loading…
Reference in new issue