Skip to content

Commit

Permalink
Added from and to parameters to top N queries to specify time range (#…
Browse files Browse the repository at this point in the history
…8132)

* Added from and to parameters to top N queries to specify time range 

Signed-off-by: Emily Guo <[email protected]>

* Update _observing-your-data/query-insights/top-n-queries.md

Co-authored-by: kolchfa-aws <[email protected]>
Signed-off-by: Emily Guo <[email protected]>

* Update _observing-your-data/query-insights/top-n-queries.md

Co-authored-by: kolchfa-aws <[email protected]>
Signed-off-by: Emily Guo <[email protected]>

* Update _observing-your-data/query-insights/top-n-queries.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>

---------

Signed-off-by: Emily Guo <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Co-authored-by: kolchfa-aws <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
  • Loading branch information
3 people authored Oct 29, 2024
1 parent 60f74c4 commit e6eb0d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions _observing-your-data/query-insights/top-n-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ GET /_insights/top_queries?type=memory
```
{% include copy-curl.html %}


To specify a time range for querying top N results, use the `from` and `to` parameters in ISO8601 format: `YYYY-MM-DD'T'HH:mm:ss.SSSZ`.
For example, to retrieve the top N queries from August 25, 2024, at 15:00 UTC to August 30, 2024, at 17:00 UTC, send the following request:

```json
GET /_insights/top_queries?from=2024-08-25T15:00:00.000Z&to=2024-08-30T17:00:00.000Z
```
{% include copy-curl.html %}

If you have a [local index exporter enabled](#configuring-a-local-index-exporter), historical queries stored in local OpenSearch indexes will also be included in the specified time range.

If your query returns no results, ensure that top N query monitoring is enabled for the target metric type and that search requests were made within the current [time window](#configuring-the-window-size).
{: .important}

Expand Down

0 comments on commit e6eb0d3

Please sign in to comment.