queries
Creates, updates, deletes, gets or lists a queries resource.
Overview
| Name | queries |
| Type | Resource |
| Id | azure.log_analytics.queries |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
author | string | Object Id of user creating the query. |
body | string | Body of the query. Required. |
description | string | Description of the query. |
displayName | string | Unique display name for your query within the Query Pack. Required. |
properties | object | Additional properties that can be set for the query. |
related | object | The related metadata items for the function. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Tags associated with the query. |
timeCreated | string (date-time) | Creation Date for the Log Analytics Query, in ISO 8601 format. |
timeModified | string (date-time) | Last modified date of the Log Analytics Query, in ISO 8601 format. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
author | string | Object Id of user creating the query. |
body | string | Body of the query. Required. |
description | string | Description of the query. |
displayName | string | Unique display name for your query within the Query Pack. Required. |
properties | object | Additional properties that can be set for the query. |
related | object | The related metadata items for the function. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Tags associated with the query. |
timeCreated | string (date-time) | Creation Date for the Log Analytics Query, in ISO 8601 format. |
timeModified | string (date-time) | Last modified date of the Log Analytics Query, in ISO 8601 format. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, query_pack_name, id, subscription_id | Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. | |
list | select | resource_group_name, query_pack_name, subscription_id | $top, includeBody, $skipToken | Gets a list of Queries defined within a Log Analytics QueryPack. |
update | update | resource_group_name, query_pack_name, id, subscription_id | Adds or Updates a specific Query within a Log Analytics QueryPack. | |
delete | delete | resource_group_name, query_pack_name, id, subscription_id | Deletes a specific Query defined within an Log Analytics QueryPack. | |
put | exec | resource_group_name, query_pack_name, id, subscription_id | Adds or Updates a specific Query within a Log Analytics QueryPack. | |
search | exec | resource_group_name, query_pack_name, subscription_id | $top, includeBody, $skipToken | Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | The id of a specific query defined in the Log Analytics QueryPack. Required. |
query_pack_name | string | The name of the Log Analytics QueryPack resource. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
$skipToken | string | Base64 encoded token used to fetch the next page of items. Default is null. Default value is None. |
$top | integer | Maximum items returned in page. Default value is None. |
includeBody | boolean | Flag indicating whether or not to return the body of each applicable query. If false, only return the query information. Default value is None. |
SELECT examples
- get
- list
Gets a specific Log Analytics Query defined within a Log Analytics QueryPack.
SELECT
id,
name,
author,
body,
description,
displayName,
properties,
related,
systemData,
tags,
timeCreated,
timeModified,
type
FROM azure.log_analytics.queries
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND query_pack_name = '{{ query_pack_name }}' -- required
AND id = '{{ id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets a list of Queries defined within a Log Analytics QueryPack.
SELECT
id,
name,
author,
body,
description,
displayName,
properties,
related,
systemData,
tags,
timeCreated,
timeModified,
type
FROM azure.log_analytics.queries
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND query_pack_name = '{{ query_pack_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $top = '{{ $top }}'
AND includeBody = '{{ includeBody }}'
AND $skipToken = '{{ $skipToken }}'
;
UPDATE examples
- update
Adds or Updates a specific Query within a Log Analytics QueryPack.
UPDATE azure.log_analytics.queries
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND query_pack_name = '{{ query_pack_name }}' --required
AND id = '{{ id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes a specific Query defined within an Log Analytics QueryPack.
DELETE FROM azure.log_analytics.queries
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND query_pack_name = '{{ query_pack_name }}' --required
AND id = '{{ id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- put
- search
Adds or Updates a specific Query within a Log Analytics QueryPack.
EXEC azure.log_analytics.queries.put
@resource_group_name='{{ resource_group_name }}' --required,
@query_pack_name='{{ query_pack_name }}' --required,
@id='{{ id }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Search a list of Queries defined within a Log Analytics QueryPack according to given search properties.
EXEC azure.log_analytics.queries.search
@resource_group_name='{{ resource_group_name }}' --required,
@query_pack_name='{{ query_pack_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@$top='{{ $top }}',
@includeBody={{ includeBody }},
@$skipToken='{{ $skipToken }}'
@@json=
'{
"related": "{{ related }}",
"tags": "{{ tags }}"
}'
;