I am working on a pie chart to identify the main categories of some data. Below are some possible values:
Apple
Peach
Perry
Strawberry
Blueberry
Cranberry
I would like to replace the value by "Other" when this is not Apple, Peach or Perry. How could I do that? using replace? using if?
Try this
.... | eval category=if(category="Apple" OR category="Peach" OR category="Perry", category, "Other")
thanks. do you think it would be possible to do this in an other way that would use less resources?
Do this after your aggregation (stats etc).
after timechart, this is not working.
The other option is using rex mode=sed
or replace()
but not sure how much more efficient that will be. Maybe I am not understanding your concern?
if I want to use rex mode=sed, or replace, how can I set the condition?