Apr 18 2019
10:35 AM
- last edited on
Apr 07 2022
05:45 PM
by
TechCommunityAP
Apr 18 2019
10:35 AM
- last edited on
Apr 07 2022
05:45 PM
by
TechCommunityAP
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 Azure Log Analytics. as per Microsoft SLA for data ingestion to Log Analytics (30 minutes to 6 hours). i tried running the Log analytics query to fetch the MySQL database details but i didn't get any results for that. Query: AzureDiagnostics | where TimeGenerated > ago(7h) | where ResourceProvider == "Microsoft.DBforMySQL" and ResourceType == "Microsoft.DBforMySQL/servers" Note: MySQL database is in East US and Azure Log Analytics is in West US but the query is working for MS SQL database with little modification. I want answer whether the Azure Log Analytics is generally available for MySQL database ? if yes, the can you help me with a sample query to get the output in log analytics. Thanks in Advance !!!!!
May 10 2019 05:01 AM
Did you get this working? If not, check this first
// check to see which resource providers you have AzureDiagnostics | where TimeGenerated > ago(7d) | summarize by ResourceProvider
If you add a count() to the above, you can see how many records you have by each ResourceProvider
Then, your query should work (adjust the days/hours to suit)
AzureDiagnostics | where TimeGenerated > ago(1d) | where ResourceProvider == "Microsoft.DBforMySQL"
May 13 2019 11:15 AM
Thanks@CliveWatson.
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
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.
May 13 2019 12:03 PM
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!
Jun 06 2019 03:58 AM