I want to get the ticket count for the aging of backlog tickets on a weekly basis. The aging of the ticket depends on the date the ticket was opened. The count should be calculated every Sunday, and the tickets should be divided depending upon the ranges mentioned, i.e. 0-5 days,6-15 and so on.
What data do you have to work with?
The data is as below :
| eval daysunresolved=if(isnull(resolved_at),round((now()-strptime(reported_date_time,"%Y-%m-%d %H:%M:%S"))/(60*60*24),0),null)
| eval agebracket=case(daysunresolved<6,"0-5 Days",daysunresolved<16,"6-15 Days",daysunresolved>15,">15 Days",true,null)
| stats count by agebracketSchedule this to run every Sunday and save the results to a summary index, making sure the time the query executed is saved.
You can then create a chart based on the summary index, using the time the query executed as your x-axis.