1

Very new to azure application insight,

I want to group all the request with respective duration. For example, I want to put the response time which is in between 0-3 second as "Green/Color", 3-5 second in "Yellow/Color" and greater than 5 should be "Red/Color".

I am using the below Kusto Query language, which need to enhanced

requests | where timestamp > ago(2h)

David Makogon
  • 69,407
  • 21
  • 141
  • 189
Jyoti Prakash Mallick
  • 2,119
  • 3
  • 21
  • 38

1 Answers1

4

You can use the case function combined with the fact that the request duration is stored in the duration field in milliseconds:

requests  
| where timestamp > ago(2h)
| extend color = case(duration <= 3000, "Green/Color", 
                       duration <= 5000, "Yellow/Color", 
                       "Red/Color")
| project timestamp, url, resultCode, color, duration
Peter Bons
  • 26,826
  • 4
  • 50
  • 74