For the complete documentation index, see llms.txt. This page is also available as Markdown.

Search Responses and Streaming

Query logs, traces, and Kubernetes events with wrapped responses and stream log and trace results.

Use the search endpoints below when you need numeric-column hints alongside query results. Logs and traces also support progressive results over Server-Sent Events (SSE).

Endpoints

Signal
Method
Endpoint
Response

Logs

POST

/api/logs/v3/search

JSON envelope or SSE

Traces

POST

/api/traces/v3/search

JSON envelope or SSE

Kubernetes events

POST

/api/k8s/v3/events/search

JSON envelope

The existing /api/logs/v2/search, /api/traces/v2/search, and /api/k8s/v2/events/search endpoints return a bare row array. Changing to a v3 path requires reading rows from data instead. The URL version does not select a different gcQL language. No X-API-Version header is required.

Authentication

Send Authorization: Bearer <YOUR_API_KEY> and X-Backend-Id: <YOUR_BACKEND_ID>. JSON requests also require Content-Type: application/json. The examples use https://api.groundcover.com; use your deployment's API URL for a self-hosted installation. Replace the example time range with one containing your data.

Request Body

Field
Type
Required
Description

start

string

Yes

Start timestamp in RFC3339 format.

end

string

Yes

End timestamp in RFC3339 format; must not precede start.

query

string

Yes for these examples

gcQL filter and pipeline.

enableStream

boolean

No

Logs/traces only. Defaults to false; set to true for SSE.

Use gcQL pagination to retrieve additional rows. These endpoints return results on the request connection; they do not return a job ID or require a polling endpoint.

Query Logs

curl --request POST 'https://api.groundcover.com/api/logs/v3/search' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'X-Backend-Id: <YOUR_BACKEND_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
  "start": "2026-10-28T10:00:00Z",
  "end": "2026-10-28T11:00:00Z",
  "query": "level:error | stats by (workload) count() as errors | sort by (errors desc) | limit 10"
}'

An illustrative response is:

data contains the query-dependent rows. valueFieldHints identifies numeric result columns, including numeric aggregation columns whose values are null. It is a hint for choosing chart values, not a fixed schema.

For traces or events, use the corresponding endpoint with a query from Query Traces or Query Kubernetes Events.

Stream Results

curl -N disables output buffering. Parse the response as SSE, with JSON inside each data: field. Log event names are logs_search; trace event names are traces_search.

Each event is the latest result snapshot: replace the previous snapshot rather than concatenating rows or summing counts. estimate indicates estimated results; done marks completion. An error after streaming starts is reported as a terminal event with done: true and an error string, so HTTP status alone is insufficient to determine success. A connection that ends without a terminal event should be treated as incomplete. To stop receiving a stream, close the HTTP connection.

Kubernetes event search does not expose the streaming option. Streaming time-series queries use the separate time-series endpoints.

Correlate Signals in One Query

Cross-domain gcQL subqueries also work through the API. For example, find log counts for sessions that recorded a RUM TypeError:

This requires collected RUM events and a matching session_id on the logs. The subquery inherits the request time window. Specify any required signal-specific scope inside the subquery as well; do not assume an outer log filter is automatically applied to another signal. Results use the same data and valueFieldHints envelope.

For current infrastructure state, a subquery such as pod:in(_from entities | kind:Pod status_phase:Running | fields name) selects logs whose pod name appears among running Pods. Narrow both sides to the relevant cluster and namespace when names are not unique. See Query Infrastructure Entities and Query RUM.

Last updated