Skip to content

Commit

Permalink
[DOCS] Adds examples of date range queries (elastic#88201)
Browse files Browse the repository at this point in the history
* [DOCS] Adds examples of date range queries

* Update docs/discover/kuery.asciidoc

Co-authored-by: Nicholas Bellerophon <[email protected]>

Co-authored-by: Nicholas Bellerophon <[email protected]>
  • Loading branch information
gchaps and nerophon authored Jan 13, 2021
1 parent 64275cd commit b181f05
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions docs/discover/kuery.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b181f05

Please sign in to comment.