Skip to content
Control Plane API
Skip navigation

Read Query Logs

Pull the lookups, connections and allocations the plane recorded for one agent over a window you choose.

Published

On this page (5)

Read Query Logs Documentation

logs returns what the plane recorded. It needs dns:logs:read.

logs

whisper-call
CALL whisper.agents({op: 'logs', args: {agent: 'checkout-bot', from: '-1h', kind: 'dns'}})

Arguments

ArgumentContract
agentThe agent to read. Accepts an identifier or an address.
kinddns for lookups, conn for connections, alloc for allocation events.
fromStart of the window.
toEnd of the window. Omit it to read up to now.
limitHow many rows to return.

from and to each accept three forms: epoch milliseconds, an RFC 3339 timestamp, or a relative offset such as -1h.

Returns

One row per event. Which columns carry a value depends on kind.

ColumnHolds
tsWhen the event happened.
kindWhich kind of event this row is.
agentThe agent it belongs to.
qnameThe name that was looked up.
qtypeThe record type asked for.
rcodeThe DNS response code returned.
decisionWhat policy did: allowed, blocked, or no opinion.
reasonWhy that decision was reached.
answerWhat the lookup resolved to.
sourceWhich channel the query arrived on.
client_srcThe address the query came from.
latency_msHow long the lookup took.
peerThe other end of a connection.
bytes_up, bytes_downBytes out and in on that connection.
packets_up, packets_downPackets out and in.
duration_msHow long the connection lasted.
parent_agentThe identity this one egressed behind.
nestedWhether the event came from a nested identity.

Reading blocked lookups

Filter on decision once the rows are in hand. On the command line the same read is one pipe:

bash
whisper logs --agent checkout-bot --from -1h --kind dns | jq '.[] | select(.decision == "blocked")'

Errors

CodeStatusMeaning
BAD_ARGS400kind is not one of the three values, or a time argument is in none of the accepted forms.
NOT_FOUND404No such agent under this account.
FORBIDDEN_SCOPE403The key does not carry dns:logs:read.
RESULT_TOO_LARGE413The window returns more than one answer can hold. Narrow from and to, or lower limit.
READ_BUSY503The store could not answer the read. Retry after the interval in retry_after.

What is kept, and for how long, follows the retention setting described in Set policy.