If I'm reading this right, you have data that has events with pods and their phases. In your example query, you appear to be using decimal values to create your ranges, but can we assume that the actual pos states fall on specific integers? Something like this might work: | makeresults count=25
| eval phase=(random()%5)+1
``` Everything above here is just to create sample data ```
``` The following statement groups and counts phases.
| stats count by phase
``` The following statement maps phases to a string equivalent ```
| eval label=case(phase=1,"A (Pending)",
phase=2,"B (Running)",
phase=3,"C (Succeeded)",
phase=4,"D (Failed)",
phase=5,"E (Stopping?)",
1=1,"Unknown") If the phase values are not discreet, and the range you mention is necessary, then you can use a case statement like this: | makeresults count=25
| eval phase=((random()%50)/10)+1
| eval phase_group=case(phase<1.5,1,
phase<2.5,2,
phase<3.5,3,
phase<4.5,4,
phase<5.5,5)
| stats count by phase_group
| eval label=case(phase_group=1,"A (Pending)",
phase_group=2,"B (Running)",
phase_group=3,"C (Succeeded)",
phase_group=4,"D (Failed)",
phase_group=5,"E (Stopping?)",
1=1,"Unknown")
... View more