docs/VictoriaLogs/logsql-examples.md: added an example on how to search for a phrase with whitespace

This commit is contained in:
Aliaksandr Valialkin 2024-06-11 19:13:40 +02:00
parent 8f5dc966f6
commit 0269c89e03
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -456,3 +456,13 @@ _time:4w _time:week_range[Mon, Fri] _time:day_range[08:00, 18:00)
It uses implicit [`AND` logical filtere](https://docs.victoriametrics.com/victorialogs/logsql/#logical-filter) for joining multiple filters
on [`_time` field](https://docs.victoriametrics.com/victorialogs/keyconcepts/#time-field).
## How to find logs with the given phrase containing whitespace?
Use [`phrase filter`](https://docs.victoriametrics.com/victorialogs/logsql/#phrase-filter). For example, the following [LogsQL query](https://docs.victoriametrics.com/victorialogs/logsql/)
returns logs with the `cannot open file` phrase over the last 5 minutes:
```logsql
_time:5m "cannot open file"
```