> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute Analytics Query

Execute a Log Analytics query.

<Note>
  External Documentation

  To learn more, visit the [Azure Log Analytics documentation](https://learn.microsoft.com/en-us/rest/api/logsquery/query/execute?view=rest-logsquery-v1\&tabs=HTTP).
</Note>

## Parameters

<div className="integrations-table">
  | Parameter            | Description                                                                                                                       |
  | -------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
  | From                 | The start of the timeframe to retrieve results from.                                                                              |
  | Query                | The Analytics KQL query to filter results by.                                                                                     |
  | Resource Group Name  | The name of the target resource group (case insensitive). Can be obtained by using the `Azure List Resource Groups Names` action. |
  | Subscription ID      | The ID of the target subscription. Can be obtained by using the `Azure List Subscriptions` action.                                |
  | To                   | The end of the timeframe to retrieve results from.                                                                                |
  | Workspace ID         | The ID of the target workspace. Can be obtained by using the `Azure Log Analytics List Workspaces In Resource Group` action.      |
  | Workspace Identifier | Select how to identify the workspace to query from.                                                                               |
  | Workspace Name       | The name of the target workspace. Can be obtained by using the `Azure Log Analytics List Workspaces In Resource Group` action.    |
</div>

## Example Output

```json theme={"dark"}
{
	"tables": [
		{
			"name": "PrimaryResult",
			"columns": [
				{
					"name": "TenantId",
					"type": "string"
				},
				{
					"name": "Computer",
					"type": "string"
				},
				{
					"name": "TimeGenerated",
					"type": "datetime"
				},
				{
					"name": "SourceSystem",
					"type": "string"
				},
				{
					"name": "StartTime",
					"type": "datetime"
				},
				{
					"name": "EndTime",
					"type": "datetime"
				},
				{
					"name": "ResourceUri",
					"type": "string"
				},
				{
					"name": "LinkedResourceUri",
					"type": "string"
				},
				{
					"name": "DataType",
					"type": "string"
				},
				{
					"name": "Solution",
					"type": "string"
				},
				{
					"name": "BatchesWithinSla",
					"type": "long"
				},
				{
					"name": "BatchesOutsideSla",
					"type": "long"
				},
				{
					"name": "BatchesCapped",
					"type": "long"
				},
				{
					"name": "TotalBatches",
					"type": "long"
				},
				{
					"name": "AvgLatencyInSeconds",
					"type": "real"
				},
				{
					"name": "Quantity",
					"type": "real"
				},
				{
					"name": "QuantityUnit",
					"type": "string"
				},
				{
					"name": "IsBillable",
					"type": "bool"
				},
				{
					"name": "MeterId",
					"type": "string"
				},
				{
					"name": "LinkedMeterId",
					"type": "string"
				},
				{
					"name": "Type",
					"type": "string"
				}
			],
			"rows": [
				[
					"b438b4f6-912a-46d5-9cb1-b44069212abc",
					"ContosoSQLSrv1",
					"2017-08-24T06:59:59Z",
					"OMS",
					"2017-08-24T06:00:00Z",
					"2017-08-24T06:59:59Z",
					"/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it",
					null,
					"Perf",
					"LogManagement",
					"1",
					"0",
					"0",
					"1",
					"1.286",
					"0.076408",
					"MBytes",
					"true",
					"a4e29a95-5b4c-408b-80e3-113f9410566e",
					"00000000-0000-0000-0000-000000000000",
					"Usage"
				],
				[
					"b438b4f6-912a-46d5-9cb1-b44069212abc",
					"Store010Web3",
					"2017-08-24T06:59:59Z",
					"OMS",
					"2017-08-24T06:00:00Z",
					"2017-08-24T06:59:59Z",
					"/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it",
					null,
					"Perf",
					"LogManagement",
					"1",
					"0",
					"0",
					"1",
					"1.7",
					"0.106767",
					"MBytes",
					"true",
					"a4e29a95-5b4c-408b-80e3-113f9410566e",
					"00000000-0000-0000-0000-000000000000",
					"Usage"
				]
			]
		}
	]
}
```

## Workflow Library Example

[Execute Analytics Query with Azure Log Analytics and Send Results Via Email](https://library.blinkops.com/workflows/execute-analytics-query-with-azure-log-analytics-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/execute-analytics-query-with-azure-log-analytics-and-send-results-via-email/canvas" />
</div>
