Query Pack Queries - Get

Gets a specific Log Analytics Query defined within a Log Analytics QueryPack.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}?api-version=2019-09-01

URI Parameters

Name In Required Type Description
id
path True

string

The id of a specific query defined in the Log Analytics QueryPack

queryPackName
path True

string

The name of the Log Analytics QueryPack resource.

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Responses

Name Type Description
200 OK

LogAnalyticsQueryPackQuery

A single query contained within the Log Analytics QueryPack.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

QueryGet

Sample request

GET https://management.azure.com/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/Microsoft.OperationalInsights/queryPacks/my-querypack/queries/a449f8af-8e64-4b3a-9b16-5a7165ff98c4?api-version=2019-09-01

Sample response

{
  "id": "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/a449f8af-8e64-4b3a-9b16-5a7165ff98c4",
  "name": "a449f8af-8e64-4b3a-9b16-5a7165ff98c4",
  "type": "microsoft.operationalinsights/queryPacks/queries",
  "systemData": {
    "createdBy": "string",
    "createdByType": "application",
    "createdAt": "2020-02-03T01:01:01.1075056Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "application",
    "lastModifiedAt": "2020-02-04T02:03:01.1974346Z"
  },
  "properties": {
    "displayName": "Exceptions - New in the last 24 hours",
    "id": "a449f8af-8e64-4b3a-9b16-5a7165ff98c4",
    "body": "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n",
    "timeModified": "2018-02-14T13:13:19.3381394Z",
    "timeCreated": "2018-02-12T11:44:39.2980634Z",
    "description": "Thie query fetcges the recent exceptions from the last 24 hours"
  }
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

IdentityType

The type of identity that creates/modifies resources

LogAnalyticsQueryPackQuery

A Log Analytics QueryPack-Query definition.

Related

The related metadata items for the function.

SystemData

Read only system data

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

IdentityType

The type of identity that creates/modifies resources

Name Type Description
application

string

key

string

managedIdentity

string

user

string

LogAnalyticsQueryPackQuery

A Log Analytics QueryPack-Query definition.

Name Type Description
id

string

Azure resource Id

name

string

Azure resource name

properties.author

string

Object Id of user creating the query.

properties.body

string

Body of the query.

properties.description

string

Description of the query.

properties.displayName

string

Unique display name for your query within the Query Pack.

properties.id

string

The unique ID of your application. This field cannot be changed.

properties.properties

object

Additional properties that can be set for the query.

properties.related

Related

The related metadata items for the function.

properties.tags

object

Tags associated with the query.

properties.timeCreated

string

Creation Date for the Log Analytics Query, in ISO 8601 format.

properties.timeModified

string

Last modified date of the Log Analytics Query, in ISO 8601 format.

systemData

SystemData

Read only system data

type

string

Azure resource type

The related metadata items for the function.

Name Type Description
categories

string[]

The related categories for the function.

resourceTypes

string[]

The related resource types for the function.

solutions

string[]

The related Log Analytics solutions for the function.

SystemData

Read only system data

Name Type Description
createdAt

string

The timestamp of resource creation (UTC)

createdBy

string

An identifier for the identity that created the resource

createdByType

IdentityType

The type of identity that created the resource

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

An identifier for the identity that last modified the resource

lastModifiedByType

IdentityType

The type of identity that last modified the resource