This page explains how to calculate and manage query compute resources in GB-hours to optimize usage within Axiom.
X-Axiom-Query-Cost-Gbms
.
POST
request to the Run query endpoint with the following configuration:
Content-Type
header with the value application/json
.
Authorization
header with the value Bearer API_TOKEN
. Replace API_TOKEN
with your Axiom API token.
apl
specifies the Axiom Processing Language (APL) query to run. In this case, "telegraf | count"
indicates that you query the telegraf
dataset and use the count
operator to aggregate the data.
startTime
and endTime
define the time range of your query. In this case, "2024-01-11T19:25:00Z"
is the start time, and "2024-02-13T19:25:00Z"
is the end time, both in ISO 8601 format. This time range limits the query to events recorded within these specific dates and times.
X-Axiom-Query-Cost-Gbms
header.
where ["my-field"] == "axiom"
filters for events where the my-field
field takes the value axiom
.
Include field-specific filters near the beginning of your query for modest savings in query costs. For more information, see Poor filter order in queries
search
operator and non-field-specific filterssearch
operator and equivalent expressions such as where * contains
or where * has
.
Using non-field-specific filters can have a significant impact on query costs. For more information, see Use the search
operator efficiently and Regular expressions when simple filters suffice.