舊版 Log Analytics 警示 REST API

本文說明如何使用舊版 API 來管理警示規則。

重要

宣佈,Log Analytics 警示 API 將於 2025 年 10 月 1 日淘汰。 您必須轉換至使用排程查詢規則 API,以取得該日期的記錄搜尋警示。 在 2019 年 6 月 1 日之後建立的 Log Analytics 工作區會使用 scheduledQueryRules API 來管理警示規則。 切換至 舊版工作區中的目前 API,以利用 Azure 監視器 scheduledQueryRules 優點

Log Analytics 警示 REST API 可讓您在 Log Analytics 中建立及管理警示。 本文提供此 API 的詳細資料和幾個執行不同作業的範例。

Log Analytics 搜尋 API 是 RESTful,可透過 Azure Resource Manager REST API 來存取。 在本文中,您將使用 ARMClient,從 PowerShell 命令列找到存取 API 的範例。 這是開放原始碼命令列工具,可簡化 Azure Resource Manager API 的叫用作業。

使用 ARMClient 和 PowerShell 是可用來存取 Log Analytics 搜尋 API 的許多選項之一。 這些工具可讓您利用 RESTful Azure Resource Manager API 呼叫 Log Analytics 工作區,並在其中執行搜尋命令。 API 會以 JSON 格式來輸出搜尋結果,以便您以程式設計方式將搜尋結果用在許多不同用途上。

先決條件

目前,在 Log Analytics 中只能使用已儲存的搜尋來建立警示。 如需詳細資訊,請參閱記錄搜尋 REST API

排程

一個已儲存的搜尋可以有一或多個排程。 排程中定義搜尋的執行頻率及識別準則的時間間隔。 排程具有下表中描述的屬性:

屬性 描述
Interval 執行搜尋的頻率。 以分鐘為單位。
QueryTimeSpan 準則評估的時間間隔。 必須等於或大於 Interval。 以分鐘為單位。
Version 所使用的 API 版本。 目前,此設定應該一律為 1

例如,假設事件查詢的 Interval 是 15 分鐘,而 Timespan 是 30 分鐘。 在此情況下,查詢會每隔 15 分鐘執行一次。 如果準則持續解析為 true 超過 30 分鐘的範圍。

擷取排程

使用 Get 方法來擷取已儲存的搜尋的所有排程。

armclient get /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search  ID}/schedules?api-version=2015-03-20

使用 Get 方法並指定排程識別碼,以擷取已儲存的搜尋的特定排程。

armclient get /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Subscription ID}/schedules/{Schedule ID}?api-version=2015-03-20

下列範例回應適用於排程:

{
   "value": [{
      "id": "subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/sampleRG/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace/savedSearches/0f0f4853-17f8-4ed1-9a03-8e888b0d16ec/schedules/a17b53ef-bd70-4ca4-9ead-83b00f2024a8",
      "etag": "W/\"datetime'2016-02-25T20%3A54%3A49.8074679Z'\"",
      "properties": {
         "Interval": 15,
         "QueryTimeSpan": 15,
         "Enabled": true,
      }
   }]
}

建立排程

使用 Put 方法並指定唯一的排程識別碼,以建立新的排程。 兩個排程即使其已儲存的相關聯搜尋不同,也不能有相同的識別碼。 當您在 Log Analytics 主控台中建立排程時,將會建立 GUID 做為排程識別碼。

注意

Log Analytics API 所建立並儲存的所有搜尋、排程和動作,都必須使用小寫名稱。

$scheduleJson = "{'properties': { 'Interval': 15, 'QueryTimeSpan':15, 'Enabled':'true' } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/mynewschedule?api-version=2015-03-20 $scheduleJson

編輯排程

針對已儲存的相同搜尋,使用 Put 方法並指定現有的排程識別碼,以修改該排程。 在下列範例中,已停用排程。 要求的主體必須包含排程的 etag。

$scheduleJson = "{'etag': 'W/\"datetime'2016-02-25T20%3A54%3A49.8074679Z'\""','properties': { 'Interval': 15, 'QueryTimeSpan':15, 'Enabled':'false' } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/mynewschedule?api-version=2015-03-20 $scheduleJson

刪除排程

使用 Delete 方法並指定排程識別碼來刪除排程。

armclient delete /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Subscription ID}/schedules/{Schedule ID}?api-version=2015-03-20

動作

一個排程可以有多個動作。 動作可能會定義一或多個要執行的程序,例如傳送電子郵件或啟動 Runbook。 動作也可能定義閾值,以判斷搜尋結果何時符合某些準則。 某些動作會同時定義這兩者,以便符合臨界值時執行處理序。

所有動作具有下表中描述的屬性。 不同類型的警示具有其他不同的屬性,如下表所述:

屬性 描述
Type 動作的類型。 目前可能的值有 AlertWebhook
Name 警示的顯示名稱。
Version 所使用的 API 版本。 目前,此設定應該一律為 1

擷取動作

使用 Get 方法來擷取排程的所有動作。

armclient get /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search  ID}/schedules/{Schedule ID}/actions?api-version=2015-03-20

使用 Put 方法並指定動作識別碼,擷取排程的特定動作。

armclient get /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Subscription ID}/schedules/{Schedule ID}/actions/{Action ID}?api-version=2015-03-20

建立或編輯動作

使用 Put 方法並指定排程特有的動作識別碼,以建立新的動作。 當您在 Log Analytics 主控台中建立動作時,動作識別碼會使用 GUID。

注意

Log Analytics API 所建立並儲存的所有搜尋、排程和動作,都必須使用小寫名稱。

針對已儲存的相同搜尋,使用 Put 方法並指定現有的動作識別碼,以修改該排程。 要求的主體必須包含排程的 etag。

建立新動作的要求格式依動作類型而不同,下列各節提供這些範例。

刪除動作

使用 Delete 方法並指定動作識別碼來刪除動作。

armclient delete /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Subscription ID}/schedules/{Schedule ID}/Actions/{Action ID}?api-version=2015-03-20

警示動作

一個排程應該只有一個警示動作。 警示動作具有下表中描述的一或多個區段:

區段 描述 使用方式
閾值 執行動作的準則。 將警示延伸至 Azure 之前或之後,都必須為每個警示指定。
嚴重性 用來在觸發時將警示分類的標籤。 將警示延伸至 Azure 之前或之後,都必須為每個警示指定。
隱藏 可停止來自警示之通知的選項。 將警示延伸至 Azure 之前或之後,可依選擇為每個警示指定。
動作群組 已指定所需動作之 Azure ActionGroup 的識別碼,例如電子郵件、簡訊、語音通話、Webhook、自動化 Runbook 和 ITSM 連接器。 將警示延伸至 Azure 之後,就必須指定。
自訂動作 修改來自 ActionGroup 之所選動作的標準輸出。 就每個警示而言為選擇性,而且可在將警示延伸至 Azure 之後使用。

臨界值

一個警示動作應該只有一個臨界值。 當已儲存的搜尋結果符合與該搜尋相關聯動作中的臨界值時,將會執行該動作中的任何其他處理序。 動作也可以只包含臨界值,以便與不包含臨界值的其他類型動作一起搭配使用。

閾值具有下表中描述的屬性:

屬性 描述
Operator 用於比較臨界值的運算子。
gt = 大於
lt = 小於
Value 臨界值。

例如,假設事件查詢的 Interval 是 15 分鐘,Timespan 是 30 分鐘,而 Threshold 大於 10。 在此情況下,每隔 15 分鐘會執行一次查詢。 如果傳回 10 個在 30 分鐘內建立的事件,就會觸發警示。

下列範例回應僅適用於只有 Threshold 的動作:

"etag": "W/\"datetime'2016-02-25T20%3A54%3A20.1302566Z'\"",
"properties": {
   "Type": "Alert",
   "Name": "My threshold action",
   "Threshold": {
      "Operator": "gt",
      "Value": 10
   },
   "Version": 1
}

使用 Put 方法並指定唯一的動作識別碼,以建立排程的新臨界值動作。

$thresholdJson = "{'properties': { 'Name': 'My Threshold', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 10 } } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/mythreshold?api-version=2015-03-20 $thresholdJson

使用 Put 方法並指定現有的動作識別碼,以修改排程的臨界值動作。 要求的主體必須包含動作的 etag。

$thresholdJson = "{'etag': 'W/\"datetime'2016-02-25T20%3A54%3A20.1302566Z'\"','properties': { 'Name': 'My Threshold', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 10 } } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/mythreshold?api-version=2015-03-20 $thresholdJson

Severity

Log Analytics 可讓您將警示分類成數個類別,以便管理和分級。 警示嚴重性層級為 informationalwarningcritical。 這些類別會對應至 Azure 警示的正規化嚴重性級別,如下表所示:

Log Analytics 嚴重性等級 Azure 警示嚴重性等級
critical Sev 0
warning Sev 1
informational Sev 2

下列範例回應僅適用於只有 ThresholdSeverity 的動作:

"etag": "W/\"datetime'2016-02-25T20%3A54%3A20.1302566Z'\"",
"properties": {
   "Type": "Alert",
   "Name": "My threshold action",
   "Threshold": {
      "Operator": "gt",
      "Value": 10
   },
   "Severity": "critical",
   "Version": 1
}

使用 Put 方法搭配唯一動作識別碼,為具有 Severity 的排程建立新動作。

$thresholdWithSevJson = "{'properties': { 'Name': 'My Threshold', 'Version':'1','Severity': 'critical', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 10 } } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/mythreshold?api-version=2015-03-20 $thresholdWithSevJson

使用 Put 方法搭配現有的動作識別碼,以修改排程的嚴重性動作。 要求的主體必須包含動作的 etag。

$thresholdWithSevJson = "{'etag': 'W/\"datetime'2016-02-25T20%3A54%3A20.1302566Z'\"','properties': { 'Name': 'My Threshold', 'Version':'1','Severity': 'critical', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 10 } } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/mythreshold?api-version=2015-03-20 $thresholdWithSevJson

隱藏

以 Log Analytics 為基礎的查詢警示會在每次達到或超出閾值時引發。 根據查詢中隱含的邏輯,可能針對一系列間隔引發警示。 結果是持續傳送通知。 為了避免這樣的情況,您可以設定 Suppress 選項來指示 Log Analytics 等到達到規定的時間長度之後,才針對該警示規則引發第二次通知。

因此,如果設定 Suppress 30 分鐘;警示將會在第一次時引發並傳送所設定的通知。 其接著會等候 30 分鐘,然後才再次針對該警示規則使用通知。 在過渡期間,警示規則會繼續執行。 只有通知會被 Log Analytics 依據指定的時間隱藏,不論在此期間內該警示規則引發多少次。

記錄 Suppress 搜尋警示規則的 屬性是使用 Throttling 值來指定。 歸併期間是使用 DurationInMinutes 值來指定。

下列範例回應僅適用於只有 ThresholdSeveritySuppress 屬性的動作。

"etag": "W/\"datetime'2016-02-25T20%3A54%3A20.1302566Z'\"",
"properties": {
   "Type": "Alert",
   "Name": "My threshold action",
   "Threshold": {
      "Operator": "gt",
      "Value": 10
   },
   "Throttling": {
   "DurationInMinutes": 30
   },
   "Severity": "critical",
   "Version": 1
}

使用 Put 方法搭配唯一動作識別碼,為具有 Severity 的排程建立新動作。

$AlertSuppressJson = "{'properties': { 'Name': 'My Threshold', 'Version':'1','Severity': 'critical', 'Type':'Alert', 'Throttling': { 'DurationInMinutes': 30 },'Threshold': { 'Operator': 'gt', 'Value': 10 } } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myalert?api-version=2015-03-20 $AlertSuppressJson

使用 Put 方法搭配現有的動作識別碼,以修改排程的嚴重性動作。 要求的主體必須包含動作的 etag。

$AlertSuppressJson = "{'etag': 'W/\"datetime'2016-02-25T20%3A54%3A20.1302566Z'\"','properties': { 'Name': 'My Threshold', 'Version':'1','Severity': 'critical', 'Type':'Alert', 'Throttling': { 'DurationInMinutes': 30 },'Threshold': { 'Operator': 'gt', 'Value': 10 } } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myalert?api-version=2015-03-20 $AlertSuppressJson

動作群組

Azure 中的所有警示都使用動作群組作為處理動作的預設機制。 使用動作群組,您可指定動作一次,然後將動作群組與 Azure 內的多個警示產生關聯,而不需要重複宣告相同的動作。 動作群組支援多個動作,像是電子郵件、簡訊、語音通話、ITSM 連線、自動化 Runbook 和 Webhook URI。

針對將警示延伸至 Azure 的使用者,排程的動作群組詳細資料現在應該與 Threshold 一起傳遞,才能建立警示。 建立警示之前,必須先在動作群組內定義電子郵件詳細資料、Webhook URL、Runbook 自動化詳細資料和其他動作。 您可以在 Azure 入口網站中從 Azure 監視器建立動作群組,或使用動作群組 API

若要建立動作群組與警示的關聯,請在警示定義中指定該動作群組的唯一 Azure Resource Manager 識別碼。 下列範例說明使用方式:

"etag": "W/\"datetime'2017-12-13T10%3A52%3A21.1697364Z'\"",
"properties": {
   "Type": "Alert",
   "Name": "test-alert",
   "Description": "I need to put a description here",
   "Threshold": {
      "Operator": "gt",
      "Value": 12
   },
   "AzNsNotification": {
      "GroupIds": [
         "/subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup"
      ]
   },
   "Severity": "critical",
   "Version": 1
}

使用 Put 方法搭配唯一動作識別碼,來為排程關聯已經存在的動作群組。 下列範例說明使用方式:

$AzNsJson = "{'properties': { 'Name': 'test-alert', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 12 },'Severity': 'critical', 'AzNsNotification': {'GroupIds': ['subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup']} } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myAzNsaction?api-version=2015-03-20 $AzNsJson

使用 Put 方法搭配現有的動作識別碼,來為排程修改已關聯的動作群組。 要求的主體必須包含動作的 etag。

$AzNsJson = "{'etag': 'datetime'2017-12-13T10%3A52%3A21.1697364Z'\"', 'properties': { 'Name': 'test-alert', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 12 },'Severity': 'critical', 'AzNsNotification': { 'GroupIds': ['subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup'] } } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myAzNsaction?api-version=2015-03-20 $AzNsJson

自訂動作

動作預設會依循通知的標準範本和格式。 但是您可以自訂一些動作,即使這些動作是由動作群組所控制。 目前,EmailSubjectWebhookPayload有可能自訂。

自訂動作群組的 EmailSubject

警示的電子郵件主旨預設為:<WorkspaceName> 的警示通知 <AlertName>。 但是您可以自訂此主旨,以便使用特定的文字或標籤,讓您在「收件匣」中輕鬆採用篩選規則。 自訂的電子郵件標頭詳細資料必須連同 ActionGroup 詳細資料一起傳送,如下列範例所示:

"etag": "W/\"datetime'2017-12-13T10%3A52%3A21.1697364Z'\"",
"properties": {
   "Type": "Alert",
   "Name": "test-alert",
   "Description": "I need to put a description here",
   "Threshold": {
      "Operator": "gt",
      "Value": 12
   },
   "AzNsNotification": {
      "GroupIds": [
         "/subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup"
      ],
      "CustomEmailSubject": "Azure Alert fired"
   },
   "Severity": "critical",
   "Version": 1
}

使用 Put 方法搭配唯一動作識別碼,來為排程關聯含有自訂值的現有動作群組。 下列範例說明使用方式:

$AzNsJson = "{'properties': { 'Name': 'test-alert', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 12 },'Severity': 'critical', 'AzNsNotification': {'GroupIds': ['subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup'], 'CustomEmailSubject': 'Azure Alert fired'} } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myAzNsaction?api-version=2015-03-20 $AzNsJson

使用 Put 方法搭配現有的動作識別碼,來為排程修改已關聯的動作群組。 要求的主體必須包含動作的 etag。

$AzNsJson = "{'etag': 'datetime'2017-12-13T10%3A52%3A21.1697364Z'\"', 'properties': { 'Name': 'test-alert', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 12 },'Severity': 'critical', 'AzNsNotification': {'GroupIds': ['subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup']}, 'CustomEmailSubject': 'Azure Alert fired' } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myAzNsaction?api-version=2015-03-20 $AzNsJson
自訂動作群組的 WebhookPayload

根據預設,透過動作群組傳送來進行 Log Analytics 的 Webhook 會具有固定的結構。 但是您可以藉由使用所支援的特定變數來自訂 JSON 承載,以符合 Webhook 端點的需求。 如需詳細資訊,請參閱 記錄搜尋警示規則的 Webhook 動作

自訂 Webhook 詳細資料必須連同 ActionGroup 詳細資料一起傳送。 其將會套用至動作群組內指定的所有 Webhook URI。 下列範例說明使用方式:

"etag": "W/\"datetime'2017-12-13T10%3A52%3A21.1697364Z'\"",
"properties": {
   "Type": "Alert",
   "Name": "test-alert",
   "Description": "I need to put a description here",
   "Threshold": {
      "Operator": "gt",
      "Value": 12
   },
   "AzNsNotification": {
      "GroupIds": [
         "/subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup"
      ],
   "CustomWebhookPayload": "{\"field1\":\"value1\",\"field2\":\"value2\"}",
   "CustomEmailSubject": "Azure Alert fired"
   },
   "Severity": "critical",
   "Version": 1
},

使用 Put 方法搭配唯一動作識別碼,來為排程關聯含有自訂值的現有動作群組。 下列範例說明使用方式:

$AzNsJson = "{'properties': { 'Name': 'test-alert', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 12 },'Severity': 'critical', 'AzNsNotification': {'GroupIds': ['subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup'], 'CustomEmailSubject': 'Azure Alert fired','CustomWebhookPayload': '{\"field1\":\"value1\",\"field2\":\"value2\"}'} } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myAzNsaction?api-version=2015-03-20 $AzNsJson

使用 Put 方法搭配現有的動作識別碼,來為排程修改已關聯的動作群組。 要求的主體必須包含動作的 etag。

$AzNsJson = "{'etag': 'datetime'2017-12-13T10%3A52%3A21.1697364Z'\"', 'properties': { 'Name': 'test-alert', 'Version':'1', 'Type':'Alert', 'Threshold': { 'Operator': 'gt', 'Value': 12 },'Severity': 'critical', 'AzNsNotification': {'GroupIds': ['subscriptions/1234a45-123d-4321-12aa-123b12a5678/resourcegroups/my-resource-group/providers/microsoft.insights/actiongroups/test-actiongroup']}, 'CustomEmailSubject': 'Azure Alert fired','CustomWebhookPayload': '{\"field1\":\"value1\",\"field2\":\"value2\"}' } }"
armclient put /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/Microsoft.OperationalInsights/workspaces/{Workspace Name}/savedSearches/{Search ID}/schedules/{Schedule ID}/actions/myAzNsaction?api-version=2015-03-20 $AzNsJson

後續步驟