Forum Discussion
Syed_Aman
Apr 18, 2019Copper Contributor
Azure Log Analytics for Azure MySQL database (PaaS Service)
Hello Everyone, I need some help in the below issue: I have enabled the diagnostic setting for Azure MySQL database (PaaS Service) in our environment and configured the alert to send the logs to Azur...
Syed_Aman
May 13, 2019Copper Contributor
ThanksCliveWatson.
I am able to get the logs for MySql database in Azure Log Analytics workspace now and i have written a query to get the failed connections details. below is the query
AzureDiagnostics
| where SubscriptionId != ""
| where TimeGenerated > ago(10m)
| where ResourceProvider == "MICROSOFT.DBFORMYSQL"
| where Category == "MySqlAuditLogs" and event_class_s == "connection_log"
| where event_subclass_s == "DISCONNECT"
| summarize logoncount= count(), TenantId=arg_max(TenantId, SubscriptionId, ip_s, TimeGenerated, LogicalServerName_s, db_s, ResourceGroup)
| where logoncount > 3
| project TenantId, SubscriptionId, ip_s, logoncount, TimeGenerated, LogicalServerName_s, db_s, ResourceGroup
but the issue which i am facing in the query is it is just giving me over all DISCONNECT counts and i need help in modifying the filter to get the failed connection count.
CliveWatson
May 13, 2019Former Employee
Hi Syed_Aman
I don't have any DBforMYSQL records
AzureDiagnostics | where SubscriptionId != "" | where TimeGenerated > ago(10m) | where ResourceProvider == "MICROSOFT.DBFORMYSQL" | where Category == "MySqlAuditLogs" and event_class_s == "connection_log" | summarize count() by event_subclass_s
The above should enable you to see what other states, like 'failed' have occurred - sorry I don't have the data so this is a guess!
- Yochanan_RachamimJun 06, 2019
Microsoft
This feature is in Private Preview at the moment... see more information here: https://github.com/MicrosoftDocs/azure-docs/issues/26763