{"id":15354,"date":"2019-07-18T16:45:50","date_gmt":"2019-07-18T16:45:50","guid":{"rendered":"https:\/\/www.microsoft.com\/en-gb\/industry\/blog\/?p=15354"},"modified":"2019-10-07T09:42:40","modified_gmt":"2019-10-07T08:42:40","slug":"azure-log-analytics-looking-at-data-and-costs-part-3","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-gb\/industry\/blog\/cross-industry\/2019\/07\/18\/azure-log-analytics-looking-at-data-and-costs-part-3\/","title":{"rendered":"Azure Log Analytics: looking at data and costs \u2013 Part 3"},"content":{"rendered":"
Part1: https:\/\/www.microsoft.com\/en-gb\/industry\/blog\/cross-industry\/2019\/03\/28\/azure-log-analytics-looking-at-data-and-costs\/ <\/a> There are two parts to this post:<\/p>\n 1. Predict Forward 1. Predict forward<\/strong><\/p>\n In the previous two posts on this topic, we’ve seen the data ‘as is’ and in the past (normally the past month) – but how to we predict the usage from that? I think its more interesting to work in GB than Bytes (as per the above example); also Azure Billing and Azure Cost Calculator use GB, so use this amended query<\/p>\n You can run this in our demo workspace here<\/a><\/p>\n Output:<\/p>\n
\nPart2: https:\/\/www.microsoft.com\/en-gb\/industry\/blog\/cross-industry\/2019\/05\/09\/azure-log-analytics-looking-at-data-and-costs-part-2\/<\/a>
\nPart3 – This post : https:\/\/www.microsoft.com\/en-gb\/industry\/blog\/cross-industry\/2019\/07\/18\/azure-log-analyt\u2026and-costs-part-3\/<\/p>\n
\n2. Add more computers<\/p>\n
\nIn the following example, you can use 30days of historical data and predict forward 30days to see the Data Capacity<\/p>\n
\n\/\/
\n\/\/ Predict data volume for the next month
\n\/\/
\nlet startDate = startofday(ago(30d)); \/\/ go back in time nn days
\nlet endDate = now(); \/\/ what is the date now
\nlet projectTo = now()+30d; \/\/ project forward nn days
\nlet projectForward = 30; \/\/ must be same as projectTo value
\nunion withsource = tt *
\n| where TimeGenerated between (startDate .. endDate )
\n| where _IsBillable == True
\n| make-series BillingVolumeNow = avg(_BilledSize) default=0 on TimeGenerated in range(startDate, projectTo, 1h)
\n| extend BillingForecast = series_decompose_forecast(BillingVolumeNow, projectForward*24)
\n| render timechart title = \"Predicted Data Capacity in 30days \"
\n<\/code><\/p>\n
\n\/\/
\n\/\/ Predict data volume for the next month
\n\/\/
\nlet startDate = startofday(ago(30d)); \/\/ go back in time nn days
\nlet endDate = now(); \/\/ what is the date now
\nlet projectTo = now()+30d; \/\/ project forward nn days
\nlet projectForward = 30; \/\/ must be same as projectTo value
\nunion withsource = tt *
\n| where TimeGenerated between (startDate .. endDate )
\n| where _IsBillable == True
\n| make-series BillingVolumeNow = avg(_BilledSize \/ (1024*1024*1024)), default=0 on TimeGenerated in range(startDate, projectTo, 1h)
\n| extend BillingForecast = series_decompose_forecast(BillingVolumeNow, projectForward*24)
\n| render timechart title = \"Predicted Data Capacity (GB) in 30days \"
\n<\/code><\/p>\n