Parseable Docs

Query a log stream


Parseable Log Query API
This endpoint allows you to query logs using PostgreSQL syntax.

The query API accepts the following parameters:

  • query: The SQL query to execute (required)
  • startTime: The start time for the query range (optional)
  • endTime: The end time for the query range (optional)
  • streamName: The name of the log stream to query (required)

Example request body:

{  "query": "SELECT * FROM log WHERE log ILIKE '%error%';",  "startTime": "2023-01-01 00:00:00.000000",  "endTime": "2023-01-01 23:59:59.999999",  "streamName": "example-stream" }

Authorization

AuthorizationRequiredBasic <token>

In: header

Request Body

application/jsonOptional
queryRequiredstring
startTimestring
endTimestring
streamNameRequiredstring

Response Body

Successful response

curl -X POST "http://ENDPOINT/api/v1/query" \  -H "Authorization: Basic <token>" \  -H "Content-Type: application/json" \  -d '{  "query": "string",  "startTime": "string",  "endTime": "string",  "streamName": "string"  }'
Empty