Set up alerts on resource log events from VPN Gateway

Occasional Visitor

I am trying to setting up monitoring for vpn status and getting below error.

 

AzureDiagnostics
| where Category == "TunnelDiagnosticLog"
| where _ResourceId == tolower("/subscriptions/xxxxx/resourceGroups/devresgrp/providers/Microsoft.Network/virtualNetworkGateways/xxx")
| where TimeGenerated > ago(5m)
| where remoteIP_s == "x.x.x.x"
| where status_s == "Disconnected"
| project TimeGenerated, OperationName, instance_s, Resource, ResourceGroup, _ResourceId
| sort by TimeGenerated asc
 
'where' operator: Failed to resolve column or scalar expression named 'remoteIP_s' If issue persists, please open a support ticket. Request id: 14aba92f-2ba5-4c1a-b622-e9914911d158
2 Replies

@atanuazure 

 

It looks like that COLUMN doesn't exist - hence the error.  You can use EXTEND and Column_ifexists to create a default value maybe?   In this case, I use "1.1.1.1" as the default - amend to suit 

 

AzureDiagnostics
//| where Category == "TunnelDiagnosticLog"
//| where _ResourceId == tolower("/subscriptions/xxxxx/resourceGroups/devresgrp/providers/Microsoft.Network/virtualNetworkGateways/xxx")
//| where TimeGenerated > ago(5d)
| limit 5
| extend remoteIP_s = iif(column_ifexists("remoteIP_s","") == true,"","1.1.1.1")
| project remoteIP_s