Group cluster log lines into patterns (browser session)
import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/logs/patterns"
payload = { "step_seconds": 11 }
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({step_seconds: 11})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/logs/patterns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/logs/patterns \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"step_seconds": 11
}
'{
"provider": "<string>",
"source": "<string>",
"note": "<string>",
"cluster_attribution": {},
"start": "<string>",
"end": "<string>",
"step_seconds": 123,
"bucket_count": 123,
"kept_days": 123,
"patterns": [
{
"level": "error",
"namespace": "<string>",
"container": "<string>",
"pattern": "<string>",
"count": 123,
"share": 123,
"first_seen": "<string>",
"last_seen": "<string>",
"sample": {
"timestamp": "<string>",
"line": "<string>",
"labels": {}
},
"history": "new",
"history_reason": "seen_in_lookback",
"history_note": "<string>",
"search_fragment": "<string>",
"bars": [
123
],
"lines_off_grid": 123
}
],
"distinct_patterns": 123,
"pattern_limit": 123,
"patterns_truncated": true,
"sampled_lines": 123,
"sample_limit": 123,
"total_hits": 123,
"total_hits_relation": "eq",
"counts_are_exact": true,
"history_start": "<string>",
"history_end": "<string>"
}Clusters
Group cluster log lines into patterns (browser session)
Session-authenticated. The newest matching log lines of the window (at most 1000) grouped into patterns, in the store the history query reads, with the same source choice and filters. Each pattern carries its level, its share of the lines grouped, its lines per bar on the log volume count’s grid, the words a search can find it by, and whether it was also written in the 7 days before. Every count is within the lines grouped, and counts_are_exact says whether that was every matching line. A store that fails the window read answers an error, never an empty list. Requires kubernetes.logs on this cluster.
POST
/
org
/
clusters
/
imported
/
{cluster_id}
/
logs
/
patterns
Group cluster log lines into patterns (browser session)
import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/logs/patterns"
payload = { "step_seconds": 11 }
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({step_seconds: 11})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/logs/patterns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/logs/patterns \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"step_seconds": 11
}
'{
"provider": "<string>",
"source": "<string>",
"note": "<string>",
"cluster_attribution": {},
"start": "<string>",
"end": "<string>",
"step_seconds": 123,
"bucket_count": 123,
"kept_days": 123,
"patterns": [
{
"level": "error",
"namespace": "<string>",
"container": "<string>",
"pattern": "<string>",
"count": 123,
"share": 123,
"first_seen": "<string>",
"last_seen": "<string>",
"sample": {
"timestamp": "<string>",
"line": "<string>",
"labels": {}
},
"history": "new",
"history_reason": "seen_in_lookback",
"history_note": "<string>",
"search_fragment": "<string>",
"bars": [
123
],
"lines_off_grid": 123
}
],
"distinct_patterns": 123,
"pattern_limit": 123,
"patterns_truncated": true,
"sampled_lines": 123,
"sample_limit": 123,
"total_hits": 123,
"total_hits_relation": "eq",
"counts_are_exact": true,
"history_start": "<string>",
"history_end": "<string>"
}Authorizations
Body
application/json
Response
Patterns among the newest matching lines