Evaluates an instant query at a single point in time using POST
POSThttps://api.logz.io/v1/metrics/prometheus/api/v1/query
Submit query data in the request body using URL-encoded form parameters. Please ensure to change the region in the URL to match your account's region.
Request
- application/x-www-form-urlencoded
Body
required
query stringrequired
Prometheus expression query string.
time string
Evaluation timestamp as an RFC3339 or Unix timestamp. Optional.
timeout string
Evaluation timeout. Defaults to the value of the -query.timeout flag.
Responses
- 200
- 400
- 500
Successful query evaluation.
- application/json
- Schema
- Example (from schema)
Schema
status string
Status of the query (e.g., success, fail).
data object
{
"status": "string",
"data": {
"resultType": "matrix",
"result": [
{
"metric": {},
"value": [
"string"
]
}
]
}
}
Invalid request parameters.
Internal server error.
Authorization: X-API-TOKEN
name: X-API-TOKENtype: apiKeydescription: You can manage your API tokens from the [Logz.io API tokens](https://app.logz.io/#/dashboard/settings/manage-tokens/api) page. API tokens are account-specific. You will need to be logged into the relevant Log Management or SIEM account to view the API tokens associated with it. To manage your API tokens, log into the relevant account in your Logz.io platform, click the gear in the top-right menu, and select [**Tools > Manage tokens > API tokens**](https://app.logz.io/#/dashboard/settings/manage-tokens/api). It's important to keep your tokens secure. API tokens carry privileges to make changes to users and accounts, so if you believe an API token has been compromised, delete it, and replace it with a new token in your integrations.in: header
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://api.logz.io/v1/metrics/prometheus/api/v1/query' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'X-API-TOKEN: <API_KEY_VALUE>'