cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DQL Query Group by Every 2 Hour

bddang
Dynatrace Enthusiast
Dynatrace Enthusiast
Hello eveyone!
I'm having the DQL statement prepare for customer. currently, they have summarized by every timestamp of the log. Is there a way to group it by every 2-3 hours?

fetch logs , scanLimitGBytes: -1
|filter isNotNull(elapsed_time)
|summarize elapsed = round(avg(toDouble(elapsed_time)),decimals:3), by:{timestamp }

 

 

 

 

1 REPLY 1

Tiit_Hallas
Dynatrace Enthusiast
Dynatrace Enthusiast

You can try the bin function: https://www.dynatrace.com/support/help/shortlink/dql-functions#bin

fetch logs , scanLimitGBytes: -1
|filter isNotNull(elapsed_time)
|summarize elapsed = round(avg(toDouble(elapsed_time)),decimals:3), by:{ bin(timestamp, 2h) }

 

I had a life once. Then I bought my first computer ...

Featured Posts