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
}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.
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
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Show child attributes
Show child attributes
Number of matching records earlier than the anchor. Defaults to 10.
Number of matching records later than the anchor. Defaults to 10.
Optional OQL pipeline. It cannot be combined with query or filters.
Response
OK
Log is the canonical wire representation of an otel_logs row.
Show child attributes
Show child attributes
Matching records earlier than the anchor, ordered oldest to newest.
Show child attributes
Show child attributes
Matching records later than the anchor, ordered oldest to newest.
Show child attributes
Show child attributes
Was this page helpful?