Robin Johansson
Robin Johansson

Reputation: 5

Cant get the query for AzureDiagnostics to work

I cant get this query to work. I got this query from Microsoft: https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-setup-alerts-virtual-network-gateway-log

But I cant get thru RemoteIP_S. What am I doing wrong?

AzureDiagnostics
| where Category == "TunnelDiagnosticLog"
| where _ResourceId == tolower("<RESOURCEID OF GATEWAY>")
| where TimeGenerated > ago(5m) 
| where remoteIP_s == "<REMOTE IP OF TUNNEL>"
| where status_s == "Disconnected"
| project TimeGenerated, OperationName, instance_s, Resource, ResourceGroup, _ResourceId 
| sort by TimeGenerated asc

Upvotes: 0

Views: 1198

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29950

The reason is that the logs would take few hours to get populated in Log Analytic work space, until that the query will fail as elements "remoteIP_s" will not exist to query.

You can wait for some hours, then check if it can work.

There are some issues for tracking this issue, see here and here.

Upvotes: 1

Related Questions