0

We have simulated some error logs within our SQL Server Managed Instance. The SQL Server error logs are within the Management folder. I have a simple requirement wherein I am stuck streaming these error logs to Azure portal via the log analytics workspace. See the attached screenshot.

Long running

Note that I need to monitor the logs and when I get that message text, I need to alert via Azure portal.

I am trying to stream it to the Log Analytics workspace using the "add diagnostic setting" feature, but I am not able to find the specific category. I can only find:

  • Resource Usage Statistics
  • Devops operations Audit Logs
  • SQL Security Audit Event

I am not able to find the error logs nor able to query using the Azure diagnostic Kusto query. Once I am able to find the log, the Azure portal will capture the log entry and will alert via Azure monitor.

Can someone advise as to how to alert via the azure portal by reading those error logs in the SQLMI.

0

1 Answer 1

1

You can build custom solutions, like create an Extended Events session that would capture error_reported events, then have a SQL Server Agent job that would read from that XEL log file and alert DBA about any new items. I will work on finishing that solution soon (we will need this).

Also, you can use Erik Darling's sp_LogHunter to scan the error log, and log all new errors to a table, and then again have a SQL Job to notify DBA by email. Not all errors are logged to Error Log though (only some of them, see sys.messages). But Error Log also might contain some items that can not be captured by XE error_reported event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.