QueryBody

Request body for executing a KQL query against a Log Analytics workspace.

AnalyticsAzureCloudLoggingMonitoring

Properties

Name Type Description
query string The KQL query to execute against the workspace.
timespan string ISO 8601 duration or time interval for the query timespan.
workspaces array List of additional workspace IDs for cross-workspace queries.
View JSON Schema on GitHub

JSON Schema

query-api-query-body-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/azure-log-analytics/refs/heads/main/json-schema/query-api-query-body-schema.json",
  "title": "QueryBody",
  "description": "Request body for executing a KQL query against a Log Analytics workspace.",
  "type": "object",
  "required": ["query"],
  "properties": {
    "query": {
      "type": "string",
      "description": "The KQL query to execute against the workspace.",
      "example": "AzureActivity | summarize count() by Category"
    },
    "timespan": {
      "type": "string",
      "description": "ISO 8601 duration or time interval for the query timespan.",
      "example": "P1D"
    },
    "workspaces": {
      "type": "array",
      "description": "List of additional workspace IDs for cross-workspace queries.",
      "items": {
        "type": "string"
      }
    }
  }
}