Here's one way of doing it index=anIndex sourcetype=aSourceType aString earliest=-481m@m latest=-1m@m
| eval age=now() - _time
| eval age_ranges=split("1,6,11,31,61,91,121,241",",")
| foreach 0 1 2 3 4 5 6 7 [ eval r=tonumber(mvindex(age_ranges, <<FIELD>>))*60, zone=if(age < 14400 + r AND age > r, <<FIELD>>, null()), z=mvappend(z, zone) ]
| stats count by z what this is effectively doing is set up the base age, which are your right hand minute values. Then as each gap is 4 hours, (14400 seconds) use a foreach loop to go round each of the 8 age bands and see if the age is in that band. The output is a multivalue field that contains the bands it is found it. Then stats count by, will count for each band, so that should give you the counts in each of your bands. Does this give you what you want
... View more