This API endpoint is deprecated
This API endpoint will be fully decommissioned on Thursday, 15th August 2024 at 16:00 UTC. Please migrate to Query API v2 - Live Tail.
This API endpoint will be fully decommissioned on Thursday, 15th August 2024 at 16:00 UTC. Please migrate to Query API v2 - Live Tail.
Fetch your Live Tail logs with a HTTP API.
Querying Live Tail returns rows based on your query. Each request returns a pagination.next
url which you can query for more logs. Note that the URL contains a cursor
query that works only when you don't change any query parameters, otherwise the behavior is not defined.
Query parameters
Comma-separated list of sources you want to query.
Filter logs with your query. This follows the same rules as Live tail. Read more about Live tail Query Language.
How many rows do you want to return? Accepts a range of 50-1000. Default: 100 rows.
Start of time range for the log query (ISO8601-formatted string: 2022-07-19T13:32:56+0000). Default: 30 minutes before to
. If to
is not specified then 30 minutes ago.
End of time range for the log query (ISO8601-formatted string: 2022-07-19T13:32:56+0000). Default: 30 minutes after from
. If from
is not specified then current time.
In what order do you want your logs? Possible values: newest_first
, oldest_first
. Default: newest_first
Headers
Bearer $TOKEN
Returned rows
Response body
{
"data": [
{
"app": "sample_app",
"source_id": "123",
"dt": "2022-07-19 12:28:14.000000",
"event.http_request_received.port": null,
"event.http_response_sent.status": null,
"message": "Hello, world!",
"level": "debug",
"context.runtime.thread_id": "70039367973540",
"context.system.pid": "14",
"context.http.path": null,
"context.http.method": null,
"context.http.host": null,
"context.http.remote_addr": null
},
{
"app": "sample_app",
"source_id": "123",
"dt": "2022-07-19 12:28:14.000000",
"event.http_request_received.port": null,
"event.http_response_sent.status": null,
"message": "Hello, world!",
"level": "debug",
"context.runtime.thread_id": "70182641597580",
"context.system.pid": "14",
"context.http.path": null,
"context.http.method": null,
"context.http.host": null,
"context.http.remote_addr": null
}
],
"pagination": {
"next": "https://telemetry.betterstack.com/api/v1/query?batch=100&cursor=MjE5PTI%3D&from=2022-07-18+12%3A29%3A14+UTC&order=newest_first&source_ids=123&to=2022-07-19+12%3A28%3A14+UTC"
}
}
curl --request GET \
--url https://telemetry.betterstack.com/api/v1/query \
--header "Authorization: Bearer $TOKEN"