Search logs
POST/v1/search
Searches your account data using the Elasticsearch Search API DSL query language. total: This call returns up to 1,000 results per query for aggregated results, or 10,000 results for non-aggregated results. Note: To ensure speed and availability of your logs, we restrict some options from the Elasticsearch defaults that could hamper system performance. Restrictions are described with their respective elements below. Please ensure to change the region in the URL to match your account's region.
Request
- application/json
Body
required
- When using
query_string
,allow_leading_wildcard
must be set tofalse
wildcard
can't start with*
or?
- Can't contain
fuzzy_max_expansions
,max_expansions
, ormax_determinized_states
-
By default, your query runs on data sent today and yesterday, UTC. You can move this 2-calendar-day window by using the
dayOffset
query parameter. -
Searches without a
timestamp
filter will return the last 2 calendar days, UTC. You can search other calendar days (up to 2 at a time) using a filter on thetimestamp
. - Can't sort or aggregate on analyzed fields, such as the
message
field - If you omit
_source
from the request, all fields are returned. - If you pass
'_source': false
, it will exclude the_source
field from the results. - When using the
size
element, the value must be ≤1000
- Can't nest 2 or more bucket aggregations of these types:
date_histogram
,geohash_grid
,histogram
,ip_ranges
,significant_terms
,terms
- Can't sort or aggregate on analyzed fields, such as the
message
field - Aggregation type
significant_terms
andmulti_terms
can't be used Note: You can useaggs
oraggregations
as the field name
The query can take any of the parameters described in the Elasticsearch Search API DSL documentation with the exceptions stated below.
Limitations
Notes on the search time range
Of the results found, the first result to return.
Possible values: <= 10,000
Default value: 10
Number of results to return
Limitations
_source object
The object includes
specifies an array of strings specifying an array of fields to return.
Array of fields to return
Field to return.
A filter applied after the aggregations have been calculated. Useful for reusing a single query to calculate several outputs with different filtering criteria. See the Elasticsearch guide for details.
Powers inverted indexing. Allows queries to look up the search term in unique sorted list by @timestamp. See the Elasticsearch guide for details.
Returns a version for each result. See the Elasticsearch guide for details.
Useful for querying for fields that don’t appear in the _source field or querying for larger documents by date or title. See the Elasticsearch guide for details.
Highlight strings in one or more fields in your search results. See the Elasticsearch guide for details.
Apply field aggregations. See the Elasticsearch guide for details.
Limitations
Responses
- 200
successful query. hits
are the total number of logs that match the query, which will always be in the 0-2 day range. total
are the actual logs that are returned when using the query, which are not limited by the selected time range.
- application/json
- Schema
Schema
object