Splunk Search

If statement

vaibhavbeohar
Path Finder

Hi
I am running search to get rating status in my report, not getting any result and getting error
" Error in 'eval' command: The expression is malformed. Expected ) " here is my search,

Thanks

"sourcetype="TicketAnalysis" | eval XYZ = if (Rating1 >="6", "Satisfied", if (Rating1 <="6" AND Rating1 >= "4" "Neutral", if (Rating1 < "4" AND Rating1 >= 1, "Dissatisfied","Unrated"))) "

Tags (1)

jbanerje
Explorer

eval Comment=if((Fund_Credit_Amt=Ack_Credit_Amt) AND (Fund_Debit_Amt=Ack_Debit_Amt) ,"MATCH","MISMATCH")

jhupka
Path Finder

Is there any particular reason you wouldn't use case instead?

smolcj
Builder
sourcetype="TicketAnalysis" | eval XYZ = if (Rating1 >="6", "Satisfied", if (Rating1 <="6" AND Rating1 >= "4" **,** "Neutral", if (Rating1 < "4" AND Rating1 >= 1, "Dissatisfied","Unrated")))

i think you missed a comma in second if statement . if (Rating1 <="6" AND Rating1 >= "4" , "Neutral"

smolcj
Builder

🙂 you have an option to remove other from pie graph in a dashboard . append this
0
thisanswer may help you;;

0 Karma

vaibhavbeohar
Path Finder

Thanks, this works now ,but if i select pie graph i am getting extra field other (1), do you have any idea why its coming only on pie graph ?

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...