From 0269c89e031313cb04159d1dc783387c9586e758 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 11 Jun 2024 19:13:40 +0200 Subject: [PATCH] docs/VictoriaLogs/logsql-examples.md: added an example on how to search for a phrase with whitespace --- docs/VictoriaLogs/logsql-examples.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/VictoriaLogs/logsql-examples.md b/docs/VictoriaLogs/logsql-examples.md index 0a453c345..b4706de3e 100644 --- a/docs/VictoriaLogs/logsql-examples.md +++ b/docs/VictoriaLogs/logsql-examples.md @@ -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" +```