Get surrounding log context
curl --request POST \
--url https://my.orq.ai/v3/logs/{id}/context \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"query": "<string>",
"filter_operator": "<string>",
"filters": [
{
"field": "<string>",
"op": "<string>",
"values": [
"<string>"
]
}
],
"before": 123,
"after": 123,
"oql": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '2023-11-07T05:31:56Z',
to: '2023-11-07T05:31:56Z',
query: '<string>',
filter_operator: '<string>',
filters: [{field: '<string>', op: '<string>', values: ['<string>']}],
before: 123,
after: 123,
oql: '<string>'
})
};
fetch('https://my.orq.ai/v3/logs/{id}/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.orq.ai/v3/logs/{id}/context"
payload = {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"query": "<string>",
"filter_operator": "<string>",
"filters": [
{
"field": "<string>",
"op": "<string>",
"values": ["<string>"]
}
],
"before": 123,
"after": 123,
"oql": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"anchor": {
"id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"observed_timestamp": "2023-11-07T05:31:56Z",
"severity_number": 123,
"severity_text": "<string>",
"body": "<string>",
"body_is_json": true,
"event_name": "<string>",
"dropped_attributes_count": 123,
"trace_flags": 123,
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"log_attributes": {},
"resource_attributes": {},
"service_name": "<string>",
"service_version": "<string>",
"deployment_environment": "<string>",
"host_name": "<string>",
"project_id": "<string>"
},
"before": [
{
"id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"observed_timestamp": "2023-11-07T05:31:56Z",
"severity_number": 123,
"severity_text": "<string>",
"body": "<string>",
"body_is_json": true,
"event_name": "<string>",
"dropped_attributes_count": 123,
"trace_flags": 123,
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"log_attributes": {},
"resource_attributes": {},
"service_name": "<string>",
"service_version": "<string>",
"deployment_environment": "<string>",
"host_name": "<string>",
"project_id": "<string>"
}
],
"after": [
{
"id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"observed_timestamp": "2023-11-07T05:31:56Z",
"severity_number": 123,
"severity_text": "<string>",
"body": "<string>",
"body_is_json": true,
"event_name": "<string>",
"dropped_attributes_count": 123,
"trace_flags": 123,
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"log_attributes": {},
"resource_attributes": {},
"service_name": "<string>",
"service_version": "<string>",
"deployment_environment": "<string>",
"host_name": "<string>",
"project_id": "<string>"
}
],
"has_more_before": true,
"has_more_after": true
}{
"message": "<string>",
"code": 123,
"details": [
"<unknown>"
]
}Logs
Get surrounding log context
Retrieve the matching log records immediately before and after an anchor log. Neighbors use the same free-text and structured filter dialect as SearchLogs and are returned in chronological order.
POST
/
v3
/
logs
/
{id}
/
context
Get surrounding log context
curl --request POST \
--url https://my.orq.ai/v3/logs/{id}/context \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"query": "<string>",
"filter_operator": "<string>",
"filters": [
{
"field": "<string>",
"op": "<string>",
"values": [
"<string>"
]
}
],
"before": 123,
"after": 123,
"oql": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '2023-11-07T05:31:56Z',
to: '2023-11-07T05:31:56Z',
query: '<string>',
filter_operator: '<string>',
filters: [{field: '<string>', op: '<string>', values: ['<string>']}],
before: 123,
after: 123,
oql: '<string>'
})
};
fetch('https://my.orq.ai/v3/logs/{id}/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.orq.ai/v3/logs/{id}/context"
payload = {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"query": "<string>",
"filter_operator": "<string>",
"filters": [
{
"field": "<string>",
"op": "<string>",
"values": ["<string>"]
}
],
"before": 123,
"after": 123,
"oql": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"anchor": {
"id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"observed_timestamp": "2023-11-07T05:31:56Z",
"severity_number": 123,
"severity_text": "<string>",
"body": "<string>",
"body_is_json": true,
"event_name": "<string>",
"dropped_attributes_count": 123,
"trace_flags": 123,
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"log_attributes": {},
"resource_attributes": {},
"service_name": "<string>",
"service_version": "<string>",
"deployment_environment": "<string>",
"host_name": "<string>",
"project_id": "<string>"
},
"before": [
{
"id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"observed_timestamp": "2023-11-07T05:31:56Z",
"severity_number": 123,
"severity_text": "<string>",
"body": "<string>",
"body_is_json": true,
"event_name": "<string>",
"dropped_attributes_count": 123,
"trace_flags": 123,
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"log_attributes": {},
"resource_attributes": {},
"service_name": "<string>",
"service_version": "<string>",
"deployment_environment": "<string>",
"host_name": "<string>",
"project_id": "<string>"
}
],
"after": [
{
"id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"observed_timestamp": "2023-11-07T05:31:56Z",
"severity_number": 123,
"severity_text": "<string>",
"body": "<string>",
"body_is_json": true,
"event_name": "<string>",
"dropped_attributes_count": 123,
"trace_flags": 123,
"scope_name": "<string>",
"scope_version": "<string>",
"scope_attributes": {},
"log_attributes": {},
"resource_attributes": {},
"service_name": "<string>",
"service_version": "<string>",
"deployment_environment": "<string>",
"host_name": "<string>",
"project_id": "<string>"
}
],
"has_more_before": true,
"has_more_after": true
}{
"message": "<string>",
"code": 123,
"details": [
"<unknown>"
]
}Authorizations
Body
application/json
Response
OK
Was this page helpful?