[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 <github@nerophon.com>

Co-authored-by: Nicholas Bellerophon <github@nerophon.com>
This commit is contained in:
gchaps 2021-01-13 08:54:21 -08:00 committed by GitHub
parent 64275cd11a
commit b181f05141
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 <<set-time-filter,time filter>> 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