import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/saved-log-searches/{search_id}"
payload = {
"name": "<string>",
"query": {
"text": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"not": True
}
],
"span": {
"from": "<string>",
"to": "<string>"
}
}
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
query: {
text: '<string>',
filters: [{field: '<string>', value: '<string>', not: true}],
span: {from: '<string>', to: '<string>'}
}
})
};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/saved-log-searches/{search_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.platform.ankra.app/org/applications/{application_id}/saved-log-searches/{search_id} \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"name": "<string>",
"query": {
"text": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"not": true
}
],
"span": {
"from": "<string>",
"to": "<string>"
}
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"query": {
"text": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"not": true
}
],
"span": {
"from": "<string>",
"to": "<string>"
}
},
"query_state": "readable",
"created_by": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_by": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>",
"error_code": "saved_log_search_name_invalid"
}{
"detail": "<string>"
}{
"detail": "<string>",
"error_code": "saved_log_search_name_invalid"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Replace a saved Logs search (browser session)
Replaces the whole search: its name and its query, both required, both stored as sent. There is no partial change, so a member left out is refused rather than read as one to clear. A replacement identical to what is stored writes nothing and is not audited; any other is audited on the application with the name, the previous name when it changed, and which of name and query changed, never the query. Requires applications.write.
import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/saved-log-searches/{search_id}"
payload = {
"name": "<string>",
"query": {
"text": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"not": True
}
],
"span": {
"from": "<string>",
"to": "<string>"
}
}
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
query: {
text: '<string>',
filters: [{field: '<string>', value: '<string>', not: true}],
span: {from: '<string>', to: '<string>'}
}
})
};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/saved-log-searches/{search_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.platform.ankra.app/org/applications/{application_id}/saved-log-searches/{search_id} \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"name": "<string>",
"query": {
"text": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"not": true
}
],
"span": {
"from": "<string>",
"to": "<string>"
}
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"query": {
"text": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"not": true
}
],
"span": {
"from": "<string>",
"to": "<string>"
}
},
"query_state": "readable",
"created_by": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_by": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>",
"error_code": "saved_log_search_name_invalid"
}{
"detail": "<string>"
}{
"detail": "<string>",
"error_code": "saved_log_search_name_invalid"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
A whole saved search: its name and its query, both required. A replacement replaces both; there is no partial change.
Response
The search as it is now, with who changed it last
One search saved for an application's Logs: a name and the query the Logs page searches with. The platform stores the query and never runs it.
readable: the stored query is one the rules accept, and query holds it. unreadable: the stored query is one the rules no longer accept (a member a later release removed, a rule it tightened, a row changed by hand); the search is still listed with its name and who saved it, so it can be replaced or removed, and query is null. Replacing it stores the new query and makes it readable.
readable, unreadable