Skip to content
Konstera
Capability catalogue
evidenceread

logs.query

Query logs (KQL)

Runs a read-only KQL query against an Azure Monitor Log Analytics workspace (including workspace-based Application Insights tables). Bounded: max_rows, 256 KB, timeout. Internal evidence: for understanding only, never quoted.

Effect
read
Fanout
no
Cache TTL
none
Traits
internal_evidence, read_only

Request arguments

Passed as the args parameter to ctx.capability.call("logs.query", …).

FieldTypeRequiredDescription
querystringyesKQL query, e.g. AppExceptions | where TimeGenerated > ago(1h) | summarize count() by ProblemId. Management commands (starting with .) are refused. A | take is appended so at most max_rows rows come back.
timespanstringnoISO-8601 duration for the query window, e.g. PT1H, P1D. Default: the connection's default_timespan (P7D). At most P30D.

Response

Returned by ctx.capability.call("logs.query", …).

FieldTypeRequiredDescription
rowsarray<array>yes
columnsarray<object>yes
rowCountintegeryes
timespanstringyes
truncatedbooleanyesTrue when rows were cut at max_rows or 256 KB, a cell was cut at 8000 characters, or the service returned a partial result

Example call

From inside your agent's handle(). The kernel resolves logs.query to the tenant's connector binding at invocation time.

response = await ctx.capability.call(
    "logs.query",
    args={
        "query": "...",
        "timespan": "...",
    },
)

See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.