Splunk Enterprise

How to get the data when conditions applied?

mahesh27
Communicator

Search:

index=xxxxx   host_ip IN(16.121.12.123 OR 16.121.12.124  OR 16.121.12.126 OR 16.121.12.128) sourcetype=xxxxxxx
|search "activity_status"=done
|eval results=if((like(response, "200"), "success", "failure")
|stats count(eval(result="success")) AS Overall_Success, count(response) as total
|eval Success_per=(Overall_Success/total)*100.0
|stats avg(Success_per) as SuccessPer



how can i write the condition like when my SuccessPer is <40  i need to see message like "The application is less thank 40 %, please check."
If the SuccessPer is >40 then SuccessPer value should display.

How can i do this???

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval message=if(Success_per < 40,"The application is less thank 40 %, please check.", null())

rafiki31
Engager

Hi,

This ?

| eval Success_per=if(Success_per<40, "The application is less thank 40 %, please check.", Success_per)

 

Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...