Polling a Query Job
This endpoint lets you poll running Query Jobs.
To poll a running Query Job, make an HTTP GET request to the job.
In the following example request, replace
{id} with the ID
from the response of the Running Query Jobs:
| Description | Request the current query status and results | Â | |
| Method | GET /api/v1/repositories/ | Â | |
| Request Data | QueryJobInput | Â | |
| Response Data | QueryResults | Â | |
| Authentication Required | yes | Â | |
| Path Arguments | Description | Data type | Required? |
id | ID of the query job | string | required |
repo | Name of repository or view to be searched | string | required |
| Return Codes | Â | ||
| 200 | Request complete | Â | |
| 400 | Request is malformed and either missing critical fields or the JSON is badly structured | Â | |
| 500 | Request failed | Â | |
When LogScale runs a search, it returns partial results, meaning the results that were found at the time query was polled. LogScale searches the newest data first, and then searches progressively backward in time.
The effect is for LogScale to produce some results as soon as
possible. If there are more results in the output, the
done: true property
in a poll query shows if the query is finished.
For example, to run a query for a query job matching ID
{id}:
$ curl https://$YOUR_LOGSCALE_URL/api/v1/repositories/$REPOSITORY_NAME/queryjobs/$ID \
-H "Authorization: Bearer $API_TOKEN"The result may be quite large as it includes both the search results, and also the metadata about the query execution for those events found up until that point.
The following example shows this output, truncated for readability:
{
"cancelled" : false,
"done" : true,
"events" : [
{
"#category" : "Alert",
"#repo" : "humio-activity",
"#severity" : "Info",
"@id" : "uICEKBYrbcj5h4pXZ08FKI3Y_153_418_1722252213",
"@ingesttimestamp" : "1722252213153",
"@rawstring" : "category=\"Alert\" severity=\"Info\" @timestamp=\"1722252213152\" message=\"Alert found no results and will not trigger\" orgId=\"p1lVrKvnGK2wV7iQDSJkanF0iOwu9XJK\" subCategory=\"Alert\" alertId=\"SYMO03XiIbyDFqwF80txtebvOOJdpvOM\" alertName=\"High Cost\" viewId=\"eS7vttlsm1SvqqTcR4aUEDAB\" dataspace=\"view_asset_migration_test_gw\" status=\"Success\" externalQueryId=\"P31-TdoncOlaRBM3CJ1hQy43CCyc\" queryProcessedEvents=\"0\" queryTimeMillis=\"139616096\" alertTime=\"1722252209403\"",
"@timestamp" : 1722252213152,
"@timestamp.nanos" : "0",
"@timezone" : "Z",
"alertId" : "SYMO03XiIbyDFqwF80txtebvOOJdpvOM",
"alertName" : "High Cost",
"alertTime" : "1722252209403",
"dataspace" : "view_asset_migration_test_gw",
"externalQueryId" : "P31-TdoncOlaRBM3CJ1hQy43CCyc",
"message" : "Alert found no results and will not trigger",
"orgId" : "p1lVrKvnGK2wV7iQDSJkanF0iOwu9XJK",
"queryProcessedEvents" : "0",
"queryTimeMillis" : "139616096",
"status" : "Success",
"subCategory" : "Alert",
"viewId" : "eS7vttlsm1SvqqTcR4aUEDAB"
},
],
"fieldStats": [
{
"fieldName": "message",
"numOfDistinctValues": 3,
"numOfOccurrences": 3,
"topValues": {
"Scheduled reports job finished": 1,
"Scheduled reports job started": 1,
"FDR polling loop finished": 1
}
},
{
"fieldName": "class",
"numOfDistinctValues": 2,
"numOfOccurrences": 3,
"topValues": {
"c.h.e.v.f.FdrJob": 1,
"c.h.s.j.ScheduledReportJob": 2
}
}
],
"filesUsed" : [],
"metaData" : {
"costs" : {
"liveCost" : 0,
"liveCostRate" : 0,
"staticCost" : 8,
"staticCostRate" : 0
},
"digestFlow" : {
"ingestTimeKnownGood" : 1722252211871,
"maxIngestLatency" : 2325,
"minIngestTimeIncluded" : 1722252211871
},
"eventCount" : 70735,
"extraData" : {
"hasMoreEvents" : "true"
},
"filterQuery" : {
"allowEventSkipping" : false,
"end" : 1722252218865,
"includeDeletedEvents" : false,
"ingestEnd" : 9223372036854775807,
"ingestStart" : 0,
"isAlertQuery" : false,
"isInteractive" : false,
"isLive" : false,
"isRepeatingSubquery" : false,
"languageVersion" : "legacy",
"noResultUntilDone" : false,
"queryString" : "query",
"showQueryEventDistribution" : false,
"start" : 1722165818865,
"useIngestTime" : false
},
"isAggregate" : false,
"pollAfter" : 300,
"processedBytes" : 102079232,
"processedEvents" : 94887,
"queryEnd" : 1722252218865,
"querySpent" : {
"day" : {
"liveCost" : 0,
"queryCount" : 1,
"staticCost" : 8
},
"hour" : {
"liveCost" : 0,
"queryCount" : 1,
"staticCost" : 8
},
"oneMinute" : {
"liveCost" : 0,
"queryCount" : 1,
"staticCost" : 8
},
"tenMinutes" : {
"liveCost" : 0,
"queryCount" : 1,
"staticCost" : 8
}
},
"queryStart" : 1722165818865,
"queuedMillis" : 0,
"quotaTotalSpent" : {
"day" : {
"liveCost" : 730,
"queryCount" : 4169,
"staticCost" : 425
},
"hour" : {
"liveCost" : 27,
"queryCount" : 159,
"staticCost" : 145
},
"oneMinute" : {
"liveCost" : 0,
"queryCount" : 5,
"staticCost" : 8
},
"tenMinutes" : {
"liveCost" : 5,
"queryCount" : 33,
"staticCost" : 55
}
},
"responderVHost" : 93,
"resultBufferSize" : 200,
"timeMillis" : 230,
"totalWork" : 78,
"warnings" : [],
"workDone" : 78
},
"queryEventDistribution" : {
"events" : [
{
"_bucket" : "1722165300000",
"_count" : "310"
},
{
"_bucket" : "1722166200000",
"_count" : "735"
},
{
"_bucket" : "1722167100000",
"_count" : "735"
},
{
"_bucket" : "1722168000000",
"_count" : "740"
},
...
{
"_bucket" : "1722250800000",
"_count" : "753"
},
{
"_bucket" : "1722251700000",
"_count" : "442"
}
],
"extraData" : {
"bucket_first_bucket" : "1722165300000",
"bucket_last_bucket" : "1722251700000",
"bucket_span_humanized" : "15m",
"bucket_span_millis" : "900000"
}
},
"warnings" : []
}The response is formatted as a JSON object with the following top-level elements:
Table: QueryResult JSON Object Fields
| Field | Type | Availability | Description |
|---|---|---|---|
| cancelled | boolean | Â |
Indicates whether the query has been cancelled or not. If
cancelled is true then
done is also always true.
|
| done | boolean | Â |
True if the static part of a search is completed. For a live
query done does not mean that the set of
results is complete, it just means that the static part of the
search (which happens at the start of the query) is complete.
|
| events | array | Â | JSON of the events as an array |
| fieldStats | array | Â | An array of field statistics objects. This object includes the field name, the number of unique values, the number of occurrences, and the top values. |
| filesUsed | array | Â | List of the files used to fulfill the query |
| filterMatches | array | Â | Entries that match the supplied filter |
| metaData | | Â | Metadata about the result set in the form of QueryMetaDataJson |
| Â Â Â Â Â Â Â Â costs | | Â | The costs of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | number | Â | The cost of execution of a live query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCostRate | number | Â | The rate of the live cost query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | number | Â | The cost for executing as a static query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCostRate | number | Â | The rate for executing static queries |
| Â Â Â Â Â Â Â Â digestFlow | | Â | Indicates how up to date the incoming data to the query is |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ingestTimeKnownGood | integer | Â | Latest known ingest time for digested data |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â maxIngestLatency | integer | Â | Maximum ingest latency for the returned data |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â minIngestTimeIncluded | integer | Â | Minimizing ingest time for data included in the results |
| Â Â Â Â Â Â Â Â eventCount | integer | Â | The number of events that matched the filter component of the query |
| Â Â Â Â Â Â Â Â extraData | | Â | Additional data about the returned events |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â correlateUsageInfo | object | Â | Â |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â sortOrder | array | Â | Â |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â timeSettingsOverwrittenFromQuery | object | Â | Â |
| Â Â Â Â Â Â Â Â fieldOrder | array | Â | Order of the returned fields |
| Â Â Â Â Â Â Â Â filterQuery | | Â |
Filter query structure containing a definition of the query as
requested. The structure matches the supplied
QueryJobInput.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â allowEventSkipping | boolean | Â |
Some LogScale functions, such as
head() and tail(),
automatically stop processing all data in the selected timeframe
and exit the query early, if more data would no longer change
the result of the query. This improves performance of the query.
Setting allowEventSkipping to
true, forces event skipping in all
circumstances. For example, when the
showQueryEventDistribution or
doneCriteria.minimumMatchedEvents parameters
are set, event skipping is disabled by default to ensure
accurate event counts, but setting
allowEventSkipping to true
overrides this, and forces skipping.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â arguments | object | Â | Dictionary of arguments specified in queries with ?param or ?{param=defaultValue} syntax. Provided arguments must be a simple dictionary of string values. If an argument is given explicitly as in ?query(param=value) then that value overrides values provided here. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â around | object | Â | Used to define the pagination of events in the result set within the given query when using pagination. Used for cursor-based paginating of filter query result. This cannot be used with aggregate results as all rows are always returned. For more information see api-search-request-around |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â autobucketCount | integer | Â |
Determines the number of buckets the system should create during
live query searches, when no other explicit bucketing aggregate
is specified (such as bucket(),
timeChart()). Higher autobucket counts
means finer granularity, but at the cost of increased memory
usage during search.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â computeFieldStats | boolean | Â |
If set to true,
computeFieldStats causes LogScale to
calculate a map of all fields of the result and their top ten
most common values, along with both the total number of
occurrences for the field, as well as its values. These results
are returned as part of the QueryResult JSON
object under the field fieldStats. This field
is always present, but empty if not requested in the query input
for the query.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â dashboardFilter | string | Â |
The ID of a query. This parameter is used to apply a dashboard
filter to a query. In LogScale, a dashboard filter is a
regular query which is applied to all queries on a dashboard,
usually prefixing the dashboard widget query. But this is not
always the case, so it can also be passed to the Query API to be
able to merge the query and the dashboard filter to form a
complete query. When querying the Query API from other clients,
that would mean that the dashboardFilter
parameter can be used when you have a set of queries where the
start of each query is identical. You can then extract the
duplicated part of the query and pass that as a
dashboardFilter instead, ensuring that it will
be applied correctly even though you use a query function with
special semantics that require it to be at the start of the
query, such as defineTable().
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â dashboardFilterVersion | string | Â | Â |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â doneCriteria | | (from 1.141) | Â |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â fractionOfDataScanned | number | Â | The query is considered done when least X percent of the input data is sampled. It should be a number in the range ]0;1] where 1 mean all events (100%) and e.g. 0.1 is approximately 10% of data that will be scanned. Sampling is done based on event size and not the number of events. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â minimumMatchedEvents | integer | Â | The query is done once at least X events have matched the filters before the first aggregation. This can be useful if you just want to show some candidates or you consider a result to be good enough when at least X events have been considered. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â minimumResultRows | integer | Â | The query is done once at least X rows are present in the output. Note that if this criterion is used in conjunction with an aggregate function there is no guarantee for how good the output results are as we don't know how much data was processed to produce the result. But it is useful for e.g. find 10 events that match this filter, similar to tail(), but does not guarantee that the most recent matches are returned. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â end | | Â | The end date and time. This parameter tells LogScale not to return results from after this date and time. See how to specify a time. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â extraLogFields | object | Â |
Extra fields set on a query that are logged to the audit and activity logs as customKey. The following rules apply to both the key and value fields:
To learn more, see extraLogFields. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â includeDeletedEvents | boolean | Â | Â |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ingestEnd | | Â | Specifies the end time based on when the data was ingested. See how to specify a time. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ingestStart | | Â | Specifies the start time based on when the data was ingested. See how to specify a time. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â isAlertQuery | boolean | Â | Indicates whether the query comes from an alert or not. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â isInteractive | boolean | Â | Whether the search is being run interactively, i.e., from with the LogScale or another UI. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â isLive | boolean | Â | Sets whether this query is live. Defaults to false . Live queries are continuously updated. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â isRepeatingSubquery | boolean | Â | Â |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â languageVersion | string | Â | The version of the query language to use |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextRunInterval | object | Â |
This parameter enables you to supply a hint to the query
engine that the next run of
the query will have an interval specified by the given
This information may be used to speed up the repeated runs of the query by allowing partial reuse of query results. Usage example: json |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â noResultUntilDone | boolean | Â |
If true, no events are included in responses to
polls until the static part of the query has completed, at which
point the full result set is returned. Metadata and progress
information are updated on each poll.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryString | string | Â | The actual query. See Query Language Syntax for details. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â showQueryEventDistribution | boolean | Â |
If true LogScale will return an additional resultset
containing a histogram of the number of events over the time
interval. Use results
instead. If both this field and
results are specified,
results takes
precedence.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â start | | Â | The start date and time. This parameter tells LogScale not to return results from before this date and time. See how to specify a time. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â timeZone | string | Â | The timezone to be used when returning dates. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â timeZoneOffsetMinutes | integer | Â |
Set the time zone offset used for bucket()
and timeChart() time slices, which is
significant if the corresponding
span is multiples of days.
Defaults to 0 (UTC);
positive numbers are to the east of UTC, so for
UTC+01:00 timezone the value
60 should be passed.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â useIngestTime | boolean | Â |
When set to true, uses the ingest time rather
than event timestamp as the basis for the time span, to control
sorting/bucketing for functions like
bucket(). Note that when
true, the time window set by both
ingestStart and ingestEnd
will be applied, in addition to the time window set by
start and end, the
effective time window being the intersection of these two time
windows.
|
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â wantsAutoBucketing | boolean | Â | Â |
| Â Â Â Â Â Â Â Â isAggregate | boolean | Â | True if this is an aggregate query |
| Â Â Â Â Â Â Â Â namedFilterQueries | array | Â | Â |
| Â Â Â Â Â Â Â Â pollAfter | integer | Â | How soon to poll the query after it has been submitted to expected results |
| Â Â Â Â Â Â Â Â processedBytes | integer | Â | Number of bytes processed to return results |
| Â Â Â Â Â Â Â Â processedEvents | integer | Â | Number of events processed in result set |
| Â Â Â Â Â Â Â Â queryEnd | integer | Â | Timestamp of the end of the query |
| Â Â Â Â Â Â Â Â querySpent | | Â | Structure defining the time and duration of the returned events |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â day | | Â | Total per day spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â hour | | Â | Total per hour spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â oneMinute | | Â | Total spent per one minute |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tenMinutes | | Â | Total spent per ten minutes |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â queryStart | integer | Â | Timestamp of when the query started |
| Â Â Â Â Â Â Â Â queuedMillis | integer | Â | Number of milliseconds the query was queued before execution |
| Â Â Â Â Â Â Â Â quotaTotalSpent | | Â | Structure definition to the total time spent used for calculating the quota |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â day | | Â | Total per day spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â hour | | Â | Total per hour spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â oneMinute | | Â | Total spent per one minute |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tenMinutes | | Â | Total spent per ten minutes |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â responderVHost | integer | Â | Number of the host returning the response |
| Â Â Â Â Â Â Â Â resultBufferSize | integer | Â | Size of the buffer used to store the result |
| Â Â Â Â Â Â Â Â timeMillis | integer | Â | Time spent executing the query in milliseconds |
| Â Â Â Â Â Â Â Â totalWork | integer | Â | Total amount of work to execute the query |
| Â Â Â Â Â Â Â Â warning | string | Â | Deprecated: Use warnings in the message root instead |
| Â Â Â Â Â Â Â Â warnings | array | Â | Use 'warnings' in the message root instead |
| Â Â Â Â Â Â Â Â workDone | integer | Â | Estimate of the work done to complete the query |
| queryEventDistribution | | Â | Information used to render the distribution graph. Only supplied when the showQueryEventDistribution is set to true. |
| Â Â Â Â Â Â Â Â events | array | Â | Detailed information about the bucket span data |
| Â Â Â Â Â Â Â Â extraData | object | Â | Â |
| warnings | array | Â | List of warnings returned using the WarningJson. |
The MetaData field contains the number of matching events, the query boundary, and information about the attributes and their unique value domains in the response. It also contains the list of warnings generated by the query.
Heartbeats
Query timeouts are in operation for query jobs. If you do not poll a query for 90 seconds, then it stops and deletes itself. Live queries keep running for an hour without being polled.
Because there may be additional delays during polling from the client, it is recommended to include a margin of error and poll for results at a shorter interval of 45 or 30 seconds.
Queries can be kept alive with the onlyHeartbeat
query parameter. For full details, including an example of usage, see
Heartbeats.
Query metaData
The query metadata contains detailed information about the execution of the query, including events, workload, and duration of the query processing.
Table: Metadata JSON Object Fields
| Field | Type | Availability | Description |
|---|---|---|---|
| costs | | Â | The costs of executing the query |
| Â Â Â Â Â Â Â Â liveCost | number | Â | The cost of execution of a live query |
| Â Â Â Â Â Â Â Â liveCostRate | number | Â | The rate of the live cost query |
| Â Â Â Â Â Â Â Â staticCost | number | Â | The cost for executing as a static query |
| Â Â Â Â Â Â Â Â staticCostRate | number | Â | The rate for executing static queries |
| digestFlow | | Â | Indicates how up to date the incoming data to the query is |
| Â Â Â Â Â Â Â Â ingestTimeKnownGood | integer | Â | Latest known ingest time for digested data |
| Â Â Â Â Â Â Â Â maxIngestLatency | integer | Â | Maximum ingest latency for the returned data |
| Â Â Â Â Â Â Â Â minIngestTimeIncluded | integer | Â | Minimizing ingest time for data included in the results |
| eventCount | integer | Â | The number of events that matched the filter component of the query |
| extraData | | Â | Additional data about the returned events |
| Â Â Â Â Â Â Â Â correlateUsageInfo | object | Â | Â |
| Â Â Â Â Â Â Â Â sortOrder | array | Â | Â |
| Â Â Â Â Â Â Â Â timeSettingsOverwrittenFromQuery | object | Â | Â |
| fieldOrder | array | Â | Order of the returned fields |
| filterQuery | | Â |
Filter query structure containing a definition of the query as
requested. The structure matches the supplied
QueryJobInput.
|
| Â Â Â Â Â Â Â Â allowEventSkipping | boolean | Â |
Some LogScale functions, such as
head() and tail(),
automatically stop processing all data in the selected timeframe
and exit the query early, if more data would no longer change
the result of the query. This improves performance of the query.
Setting allowEventSkipping to
true, forces event skipping in all
circumstances. For example, when the
showQueryEventDistribution or
doneCriteria.minimumMatchedEvents parameters
are set, event skipping is disabled by default to ensure
accurate event counts, but setting
allowEventSkipping to true
overrides this, and forces skipping.
|
| Â Â Â Â Â Â Â Â arguments | object | Â | Dictionary of arguments specified in queries with ?param or ?{param=defaultValue} syntax. Provided arguments must be a simple dictionary of string values. If an argument is given explicitly as in ?query(param=value) then that value overrides values provided here. |
| Â Â Â Â Â Â Â Â around | object | Â | Used to define the pagination of events in the result set within the given query when using pagination. Used for cursor-based paginating of filter query result. This cannot be used with aggregate results as all rows are always returned. For more information see api-search-request-around |
| Â Â Â Â Â Â Â Â autobucketCount | integer | Â |
Determines the number of buckets the system should create during
live query searches, when no other explicit bucketing aggregate
is specified (such as bucket(),
timeChart()). Higher autobucket counts
means finer granularity, but at the cost of increased memory
usage during search.
|
| Â Â Â Â Â Â Â Â computeFieldStats | boolean | Â |
If set to true,
computeFieldStats causes LogScale to
calculate a map of all fields of the result and their top ten
most common values, along with both the total number of
occurrences for the field, as well as its values. These results
are returned as part of the QueryResult JSON
object under the field fieldStats. This field
is always present, but empty if not requested in the query input
for the query.
|
| Â Â Â Â Â Â Â Â dashboardFilter | string | Â |
The ID of a query. This parameter is used to apply a dashboard
filter to a query. In LogScale, a dashboard filter is a
regular query which is applied to all queries on a dashboard,
usually prefixing the dashboard widget query. But this is not
always the case, so it can also be passed to the Query API to be
able to merge the query and the dashboard filter to form a
complete query. When querying the Query API from other clients,
that would mean that the dashboardFilter
parameter can be used when you have a set of queries where the
start of each query is identical. You can then extract the
duplicated part of the query and pass that as a
dashboardFilter instead, ensuring that it will
be applied correctly even though you use a query function with
special semantics that require it to be at the start of the
query, such as defineTable().
|
| Â Â Â Â Â Â Â Â dashboardFilterVersion | string | Â | Â |
| Â Â Â Â Â Â Â Â doneCriteria | | (from 1.141) | Â |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â fractionOfDataScanned | number | Â | The query is considered done when least X percent of the input data is sampled. It should be a number in the range ]0;1] where 1 mean all events (100%) and e.g. 0.1 is approximately 10% of data that will be scanned. Sampling is done based on event size and not the number of events. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â minimumMatchedEvents | integer | Â | The query is done once at least X events have matched the filters before the first aggregation. This can be useful if you just want to show some candidates or you consider a result to be good enough when at least X events have been considered. |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â minimumResultRows | integer | Â | The query is done once at least X rows are present in the output. Note that if this criterion is used in conjunction with an aggregate function there is no guarantee for how good the output results are as we don't know how much data was processed to produce the result. But it is useful for e.g. find 10 events that match this filter, similar to tail(), but does not guarantee that the most recent matches are returned. |
| Â Â Â Â Â Â Â Â end | | Â | The end date and time. This parameter tells LogScale not to return results from after this date and time. See how to specify a time. |
| Â Â Â Â Â Â Â Â extraLogFields | object | Â |
Extra fields set on a query that are logged to the audit and activity logs as customKey. The following rules apply to both the key and value fields:
To learn more, see extraLogFields. |
| Â Â Â Â Â Â Â Â includeDeletedEvents | boolean | Â | Â |
| Â Â Â Â Â Â Â Â ingestEnd | | Â | Specifies the end time based on when the data was ingested. See how to specify a time. |
| Â Â Â Â Â Â Â Â ingestStart | | Â | Specifies the start time based on when the data was ingested. See how to specify a time. |
| Â Â Â Â Â Â Â Â isAlertQuery | boolean | Â | Indicates whether the query comes from an alert or not. |
| Â Â Â Â Â Â Â Â isInteractive | boolean | Â | Whether the search is being run interactively, i.e., from with the LogScale or another UI. |
| Â Â Â Â Â Â Â Â isLive | boolean | Â | Sets whether this query is live. Defaults to false . Live queries are continuously updated. |
| Â Â Â Â Â Â Â Â isRepeatingSubquery | boolean | Â | Â |
| Â Â Â Â Â Â Â Â languageVersion | string | Â | The version of the query language to use |
| Â Â Â Â Â Â Â Â nextRunInterval | object | Â |
This parameter enables you to supply a hint to the query
engine that the next run of
the query will have an interval specified by the given
This information may be used to speed up the repeated runs of the query by allowing partial reuse of query results. Usage example: json |
| Â Â Â Â Â Â Â Â noResultUntilDone | boolean | Â |
If true, no events are included in responses to
polls until the static part of the query has completed, at which
point the full result set is returned. Metadata and progress
information are updated on each poll.
|
| Â Â Â Â Â Â Â Â queryString | string | Â | The actual query. See Query Language Syntax for details. |
| Â Â Â Â Â Â Â Â showQueryEventDistribution | boolean | Â |
If true LogScale will return an additional resultset
containing a histogram of the number of events over the time
interval. Use results
instead. If both this field and
results are specified,
results takes
precedence.
|
| Â Â Â Â Â Â Â Â start | | Â | The start date and time. This parameter tells LogScale not to return results from before this date and time. See how to specify a time. |
| Â Â Â Â Â Â Â Â timeZone | string | Â | The timezone to be used when returning dates. |
| Â Â Â Â Â Â Â Â timeZoneOffsetMinutes | integer | Â |
Set the time zone offset used for bucket()
and timeChart() time slices, which is
significant if the corresponding
span is multiples of days.
Defaults to 0 (UTC);
positive numbers are to the east of UTC, so for
UTC+01:00 timezone the value
60 should be passed.
|
| Â Â Â Â Â Â Â Â useIngestTime | boolean | Â |
When set to true, uses the ingest time rather
than event timestamp as the basis for the time span, to control
sorting/bucketing for functions like
bucket(). Note that when
true, the time window set by both
ingestStart and ingestEnd
will be applied, in addition to the time window set by
start and end, the
effective time window being the intersection of these two time
windows.
|
| Â Â Â Â Â Â Â Â wantsAutoBucketing | boolean | Â | Â |
| isAggregate | boolean | Â | True if this is an aggregate query |
| namedFilterQueries | array | Â | Â |
| pollAfter | integer | Â | How soon to poll the query after it has been submitted to expected results |
| processedBytes | integer | Â | Number of bytes processed to return results |
| processedEvents | integer | Â | Number of events processed in result set |
| queryEnd | integer | Â | Timestamp of the end of the query |
| querySpent | | Â | Structure defining the time and duration of the returned events |
| Â Â Â Â Â Â Â Â day | | Â | Total per day spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â hour | | Â | Total per hour spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â oneMinute | | Â | Total spent per one minute |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â tenMinutes | | Â | Total spent per ten minutes |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| queryStart | integer | Â | Timestamp of when the query started |
| queuedMillis | integer | Â | Number of milliseconds the query was queued before execution |
| quotaTotalSpent | | Â | Structure definition to the total time spent used for calculating the quota |
| Â Â Â Â Â Â Â Â day | | Â | Total per day spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â hour | | Â | Total per hour spent executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â oneMinute | | Â | Total spent per one minute |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| Â Â Â Â Â Â Â Â tenMinutes | | Â | Total spent per ten minutes |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â liveCost | integer | Â | Live cost of executing the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â queryCount | integer | Â | Number of executions of the query |
| Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â staticCost | integer | Â | Static cost of executing the query |
| responderVHost | integer | Â | Number of the host returning the response |
| resultBufferSize | integer | Â | Size of the buffer used to store the result |
| timeMillis | integer | Â | Time spent executing the query in milliseconds |
| totalWork | integer | Â | Total amount of work to execute the query |
| warning | string | Â | Deprecated: Use warnings in the message root instead |
| warnings | array | Â | Use 'warnings' in the message root instead |
| workDone | integer | Â | Estimate of the work done to complete the query |
Query extraData
The extraData contains information
about first and last bucket timestamps and a humanized version of the
returned data relative time span.
Table: ExtraData JSON Object Fields
| Field | Type | Availability | Description |
|---|---|---|---|
| bucket_first_bucket | string | Â | Timestamp of the first bucket in the returned events |
| bucket_last_bucket | string | Â | Timestamp of the last bucket in the returned events |
| bucket_span_humanized | string | Â | Human-readable description of the bucket span |
| bucket_span_millis | string | Â | Span of the returned buckets in milliseconds |
Query warnings
Warnings when executing a query are returned in a
WarningJson structure within the
overall query response. The warnings are included here to avoid the
whole query failing and instead highlight individual warnings within the
query process. The following table shows the structure of the warning:
Table: Warning JSON Object Fields
| Field | Type | Availability | Description |
|---|---|---|---|
| category | string | Â | Warnings are categorised to allow you to deal with a whole set of warnings the same way. Other values may be returned if cluster nodes are out of sync, using a newer or older version of LogScale. |
| classification | string | Â | Â |
| code | string | Â | A stable message code that can be used to compare error types or look up error descriptions. |
| message | string | Â | A Human readable text describing the warning. |