A query to help me find how out how much data is being collected in my SQL DB and also its associated costs?

Darragh Martin 86 Reputation points
2023-07-18T10:30:57.6966667+00:00

Im looking to run a custom query to find a way to calculate the amount of data that is being sent to log analytics so we know how much this will cost. I want it to access my sql DB etc

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,258 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 25,687 Reputation points Microsoft Employee
    2023-07-18T14:40:02.8733333+00:00

    Hi, @Darragh Martin

    To calculate the amount of data that is being sent to Log Analytics from your SQL DB, you can use Log Analytics log queries. You can use the following query to calculate the amount of data that is being sent to Log Analytics from your SQL DB:

    AzureDiagnostics

    | where Category == "SQLSecurityAuditEvents"

    | where ResourceId contains "<your-sql-db-name>"

    | where TimeGenerated > ago(1d)

    | summarize SizeInMB = sum(_BilledSize) / 1024 / 1024 by bin(TimeGenerated, 1h)

    To estimate the cost of sending this data to Log Analytics, you can use the Azure Monitor pricing calculator

    https://azure.microsoft.com/en-us/pricing/calculator/?service=monitor%5B1%5D%28#doc-pos=0)%3C/span%3E%3C/span%3E)

    Regards

    Geetha

    0 comments No comments