Skip to content

KQL Cafe - April 2024

Recording and Presentation

Hosts

Guests

News

Our Guest

Learn KQL - Series

SigninLogs
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend series_sum=series_sum(Logons)
SigninLogs
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| project series_stats(Logons)
SigninLogs
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend series_decompose(Logons)
SigninLogs
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend series_decompose(Logons)
| render timechart 
SigninLogs
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend outliers=series_outliers(Logons)
| render timechart 
SigninLogs
| where TimeGenerated > ago(14d)
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend series_decompose_anomalies(Logons)
SigninLogs
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend series_decompose(Logons)
| render timechart 
SigninLogs
| where TimeGenerated > ago(14d)
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend series_decompose_anomalies(Logons)
SigninLogs
| where TimeGenerated > ago(14d)
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend (AnomaliesDetected, AnomaliesScore, AnomaliesBaseline) = series_decompose_anomalies(Logons)
| mv-expand Logons to typeof(double), TimeGenerated to typeof(datetime), AnomaliesDetected to typeof(double), AnomaliesScore to typeof(double), AnomaliesBaseline to typeof(long)
| render timechart  
SigninLogs
| where TimeGenerated > ago(14d)
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend (AnomaliesDetected, AnomaliesScore, AnomaliesBaseline) = series_decompose_anomalies(Logons)
| mv-expand Logons to typeof(double), TimeGenerated to typeof(datetime), AnomaliesDetected to typeof(double), AnomaliesScore to typeof(double), AnomaliesBaseline to typeof(long)
| extend AnomaliesDetected = AnomaliesDetected * (AnomaliesBaseline*2)
| render timechart  
SigninLogs
| where TimeGenerated > ago(14d)
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend (AnomaliesDetected, AnomaliesScore, AnomaliesBaseline) = series_decompose_anomalies(Logons, 1.5, 24, "linefit",0,"tukey")
| mv-expand Logons to typeof(double), TimeGenerated to typeof(datetime), AnomaliesDetected to typeof(double), AnomaliesScore to typeof(double), AnomaliesBaseline to typeof(long)
| extend AnomaliesDetected = AnomaliesDetected * (AnomaliesBaseline*2)
| render timechart  
SigninLogs
| where TimeGenerated > ago(14d)
| make-series Logons=count() default=0 on TimeGenerated from ago(14d) to now() step 1h
| extend (AnomaliesDetected, AnomaliesScore, AnomaliesBaseline) = series_decompose_anomalies(Logons, 1.5, 24, "linefit",0,"ctukey",0.6)
| mv-expand Logons to typeof(double), TimeGenerated to typeof(datetime), AnomaliesDetected to typeof(double), AnomaliesScore to typeof(double), AnomaliesBaseline to typeof(long)
| extend AnomaliesDetected = AnomaliesDetected * (AnomaliesBaseline*2)
| render timechart 

What did you do with KQL this month

Azure Files

StorageFileLogs
| where Uri contains SuspiciousFilename.txt"
| where Category == "StorageWrite" and
    OperationName == "Write" and 
    StatusCode == "0"
| project-reorder TimeGenerated, LastModifiedTime, SmbPrimarySID, CallerIpAddress
StorageFileLogs
| where TimeGenerated > ago(90d)
| where _IsBillable == true
| summarize TotalVolumeGBLog = round(sum(_BilledSize/1024/1024/1024),2)  by bin(TimeGenerated, 1d) 
// Sum all
| summarize sum(TotalVolumeGBLog)