Count cluster log lines per interval and level
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/logs/volume"
payload = { "step_seconds": 11 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({step_seconds: 11})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/logs/volume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/logs/volume \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step_seconds": 11
}
'{
"provider": "<string>",
"source": "<string>",
"note": "<string>",
"cluster_attribution": {},
"start": "<string>",
"end": "<string>",
"step_seconds": 123,
"exact": true,
"kept_days": 123,
"buckets": [
{
"start": "<string>",
"total": 123,
"levels": {
"error": 123,
"warn": 123,
"info": 123,
"debug": 123,
"other": 123
}
}
]
}Clusters
Count cluster log lines per interval and level
Count of the cluster’s log lines per step and severity, counted by the store the history query reads, with the same source choice and filters. A store that fails or refuses answers an error, never empty bars.
This is the API-token route. It requires kubernetes.logs on the cluster, and a token’s scopes narrow it.
POST
/
api
/
v1
/
org
/
clusters
/
imported
/
{cluster_id}
/
logs
/
volume
Count cluster log lines per interval and level
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/logs/volume"
payload = { "step_seconds": 11 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({step_seconds: 11})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/logs/volume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/logs/volume \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step_seconds": 11
}
'{
"provider": "<string>",
"source": "<string>",
"note": "<string>",
"cluster_attribution": {},
"start": "<string>",
"end": "<string>",
"step_seconds": 123,
"exact": true,
"kept_days": 123,
"buckets": [
{
"start": "<string>",
"total": 123,
"levels": {
"error": 123,
"warn": 123,
"info": 123,
"debug": 123,
"other": 123
}
}
]
}Authorizations
Body
application/json
Response
Line counts per bar and level