Validate then Save a KQL Query
A 2-step recipe with Azure Log Analytics. We can help you get access.
Recipe · 2 steps
Validate then Save a KQL Query
with Azure Log Analytics
Validate a KQL query by running it, then persist it as a saved search.
- Execute the KQL query against the workspace to confirm it parses and returns tabular results before it is persisted.
- Persist the validated query as a saved search on the workspace so it can be rerun and shared later.
What you'll need to have ready
- workspaceId: The customer (workspace) GUID used by the query endpoint.
- query: The KQL query to validate and persist.
- timespan: Optional ISO 8601 duration used when validating the query (e.g. P1D).
- subscriptionId: The ID of the target Azure subscription.
- resourceGroupName: The resource group that contains the workspace.
- workspaceName: The management name of the Log Analytics workspace.
- savedSearchId: The ID to assign the new or updated saved search.
- category: The category to file the saved search under (e.g. General Exploration).
- displayName: The display name for the saved search.
- managementApiVersion: The management API version to use.
For your developer
Arazzo workflow azure-log-analytics:promote-query-to-saved-search, 2 operations: postQuery → createOrUpdateSavedSearch. Specs on APIs.io.