From b181f05141ec4b84627a8e68653af1706436d6d6 Mon Sep 17 00:00:00 2001 From: gchaps <33642766+gchaps@users.noreply.github.com> Date: Wed, 13 Jan 2021 08:54:21 -0800 Subject: [PATCH] [DOCS] Adds examples of date range queries (#88201) * [DOCS] Adds examples of date range queries * Update docs/discover/kuery.asciidoc Co-authored-by: Nicholas Bellerophon Co-authored-by: Nicholas Bellerophon --- docs/discover/kuery.asciidoc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/discover/kuery.asciidoc b/docs/discover/kuery.asciidoc index feb16190cb34..8c0012fb6c6b 100644 --- a/docs/discover/kuery.asciidoc +++ b/docs/discover/kuery.asciidoc @@ -111,13 +111,35 @@ tags:(success and info and security) [discrete] === Range queries -KQL supports `>`, `>=`, `<`, and `<=` on numeric and date types. For example: +KQL supports `>`, `>=`, `<`, and `<=` on numeric and date types. [source,yaml] ------------------- -account_number >= 100 and items_sold <= 200 and @timestamp >= now-5m +account_number >= 100 and items_sold <= 200 ------------------- +[discrete] +=== Date range queries + +Typically, Kibana's <> is sufficient for setting a time range, +but in some cases you might need to search on dates. Include the date range in quotes. + +[source,yaml] +------------------- +@timestamp < "2021-01-02T21:55:59" +------------------- + +[source,yaml] +------------------- +@timestamp < "2021-01" +------------------- + +[source,yaml] +------------------- +@timestamp < "2021" +------------------- + + [discrete] === Exist queries