There are two ways you could do it.
Option 1
Using your case statements you need to add double quotes for values 5, 6 and 7 on right side of evaluation expression.
index=java host=*myhost* "PLACEORDER_API_UNSUCCESSFUL" orderSourceId=7 OR orderSourceId=6 OR orderSourceId=5 | eval Channel=case(orderSourceId == "7", "Desktop", orderSourceId == "6", "Andriod", orderSourceId == "5", "iOS") | stats count AS Failure BY Channel
Option 2
index=java host=*myhost* "PLACEORDER_API_UNSUCCESSFUL" orderSourceId=7 OR orderSourceId=6 OR orderSourceId=5 | eval Channel=orderSourceId | replace "7" with "Desktop" in Channel|replace "6" with "Android" in Channel| replace "5" with "iOS" in Channel| stats count AS Failure BY Channel
PS:
Instead of eval Channel=orderSourceID
you can also use rename orderSourceId
as Channel.
While Using replace
command numbers 5, 6 and 7 need not
be in double quotes, but safety does
not harm 🙂
... View more