Search cluster log history in the selected store
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/logs/query"
payload = {
"start": "<string>",
"end": "<string>",
"since": "<string>",
"search": "<string>",
"raw_query": "<string>",
"direction": "<string>",
"namespaces": ["<string>"],
"pods": ["<string>"],
"containers": ["<string>"],
"source": "auto",
"limit": 123
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '<string>',
end: '<string>',
since: '<string>',
search: '<string>',
raw_query: '<string>',
direction: '<string>',
namespaces: ['<string>'],
pods: ['<string>'],
containers: ['<string>'],
source: 'auto',
limit: 123
})
};
fetch('https://platform.ankra.app/org/clusters/imported/{cluster_id}/logs/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/logs/query \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"start": "<string>",
"end": "<string>",
"since": "<string>",
"search": "<string>",
"raw_query": "<string>",
"direction": "<string>",
"namespaces": [
"<string>"
],
"pods": [
"<string>"
],
"containers": [
"<string>"
],
"source": "auto",
"limit": 123
}
'{
"provider": "<string>",
"source": "<string>",
"note": "<string>",
"entries": [
{
"timestamp": "<string>",
"line": "<string>",
"labels": {}
}
],
"total_hits": 123,
"total_hits_relation": "eq",
"truncated": true,
"start": "<string>",
"end": "<string>",
"cluster_attribution": {}
}Clusters
Search cluster log history in the selected store
Session-authenticated historical search. Requires kubernetes.logs on this cluster. An explicit source never replaces a saved connection or changes shipping. Hosted reads remain pinned to the organisation and cluster.
POST
/
org
/
clusters
/
imported
/
{cluster_id}
/
logs
/
query
Search cluster log history in the selected store
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/logs/query"
payload = {
"start": "<string>",
"end": "<string>",
"since": "<string>",
"search": "<string>",
"raw_query": "<string>",
"direction": "<string>",
"namespaces": ["<string>"],
"pods": ["<string>"],
"containers": ["<string>"],
"source": "auto",
"limit": 123
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '<string>',
end: '<string>',
since: '<string>',
search: '<string>',
raw_query: '<string>',
direction: '<string>',
namespaces: ['<string>'],
pods: ['<string>'],
containers: ['<string>'],
source: 'auto',
limit: 123
})
};
fetch('https://platform.ankra.app/org/clusters/imported/{cluster_id}/logs/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/logs/query \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"start": "<string>",
"end": "<string>",
"since": "<string>",
"search": "<string>",
"raw_query": "<string>",
"direction": "<string>",
"namespaces": [
"<string>"
],
"pods": [
"<string>"
],
"containers": [
"<string>"
],
"source": "auto",
"limit": 123
}
'{
"provider": "<string>",
"source": "<string>",
"note": "<string>",
"entries": [
{
"timestamp": "<string>",
"line": "<string>",
"labels": {}
}
],
"total_hits": 123,
"total_hits_relation": "eq",
"truncated": true,
"start": "<string>",
"end": "<string>",
"cluster_attribution": {}
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.
Path Parameters
Body
application/json
Read auto (connected source first, hosted only when no source is connected), connected only, or Ankra hosted logs only. An explicit choice never switches on empty results or failure and does not alter the saved connection.
Available options:
auto, connected, ankra_hosted Response
Scoped log search results