We have range of statua from 200 to 600. Want to search logs and create a output in below sample for range as 200 to 400 as success, 401 to 500 as exception, 501 to 500 as failure:
Sucess - 100
E...
See more...
We have range of statua from 200 to 600. Want to search logs and create a output in below sample for range as 200 to 400 as success, 401 to 500 as exception, 501 to 500 as failure:
Sucess - 100
Exceptio - 44
Failure - 3
I am able to get above format data but getting duplicate rows for each category e.g.
Success - 10
Success - 40
Sucess - 50
Exception - 20
Exception - 24
Failure - 1
Failure -2
Query
Ns=abc app_name= xyz
| stats count by status
| eval status=if(status>=200 and status<400,"Success",status)
| eval status=if(status>=400 and status<500,"Exception",status)
| eval status=if(status>=500,"Failure",status)
Kindly help.