Log Analytics query for event data

Priya Jha 901 Reputation points
2023-01-04T07:28:32.613+00:00

Hi All,

I have enabled Azure Log Analytics on my Azure SQL DB. I have a requirement wherein i need to display the queries and the executed by person details in an hourly slot in an excel as below:

275913-image.png

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SSingh-MSFT 16,461 Reputation points Moderator
    2023-01-05T06:13:21.317+00:00

    Hi @Priya Jha ,

    Thanks for posting question in Microsoft Q&A platform.

    As I understand from the question, you want an excel with the columns mentioned in the screenshot.

    You can achieve this using System Dynamic Management Views.

    For example in order to fetch Query and execution time:

    276355-image.png
    You may combine the DMVs as per the requirement and generate output. Reference: sys-dm-exec-sql-text-transact-sql

    There is an option to export data in Azure portal in Query editor:

    276374-image.png

    Hope this helps. Let us know if further queries.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.