Saved Searches - Create Or Update

Creates or updates a saved search for a given workspace.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}?api-version=2015-03-20

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The Subscription ID.

resourceGroupName
path True
  • string

The Resource Group name.

Regex pattern: ^[-\w\._\(\)]+$

workspaceName
path True
  • string

The Log Analytics Workspace name.

savedSearchId
path True
  • string

The id of the saved search.

api-version
query True
  • string

The client API version.

Request Body

Name Required Type Description
eTag
  • string

The ETag of the saved search.

properties.category True
  • string

The category of the saved search. This helps the user to find a saved search faster.

properties.displayName True
  • string

Saved search display name.

properties.query True
  • string

The query expression for the saved search. Please see https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference.

properties.tags

The tags attached to the saved search.

properties.version
  • integer

The version number of the query language. The current version is 2 and is the default.

Responses

Name Type Description
200 OK

OK response definition.

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

SavedSearchCreateOrUpdate

Sample Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/TestRG/providers/Microsoft.OperationalInsights/workspaces/TestWS/savedSearches/00000000-0000-0000-0000-00000000000?api-version=2015-03-20
{
  "properties": {
    "category": "Saved Search Test Category",
    "displayName": "Create or Update Saved Search Test",
    "query": "Heartbeat | summarize Count() by Computer",
    "version": 2,
    "tags": [
      {
        "name": "Group",
        "value": "Computer"
      }
    ]
  }
}

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/AtlantisDemo/savedSearches/test-new-saved-search-id-2015",
  "eTag": "W/\"datetime'2017-10-02T23%3A15%3A41.0709875Z'\"",
  "properties": {
    "category": "Saved Search Test Category",
    "displayName": "Create or Update Saved Search Test",
    "query": "Heartbeat | summarize Count() by Computer",
    "version": 2
  }
}

Definitions

SavedSearch

Value object for saved search results.

Tag

A tag of a saved search.

SavedSearch

Value object for saved search results.

Name Type Description
eTag
  • string

The ETag of the saved search.

id
  • string

The id of the saved search.

name
  • string

The name of the saved search.

properties.category
  • string

The category of the saved search. This helps the user to find a saved search faster.

properties.displayName
  • string

Saved search display name.

properties.query
  • string

The query expression for the saved search. Please see https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference.

properties.tags

The tags attached to the saved search.

properties.version
  • integer

The version number of the query language. The current version is 2 and is the default.

type
  • string

The type of the saved search.

Tag

A tag of a saved search.

Name Type Description
name
  • string

The tag name.

value
  • string

The tag value.