Splunk Search

Help joining the 2 below searches

tomjb94
Observer

Hi - 

We have a requirement to join the below eval statement searches, would it be possible if someone could assist with the solution please?

eval search 1 = index="wpg" host=*pz-pay* OrderSummary | stats count AS "Total"
eval search 2 = index="wpg" host=*pz-pay* OrderSummary AND "Address is invalid, it might contain a card number") | stats count AS "Failure"
eval result =( search 1/search 2)*100

Thanks,

Tom

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this

(index="wpg" host=*pz-pay*) (OrderSummary OR (OrderSummary AND "Address is invalid, it might contain a card number"))
| eval is_invalid=if(searchmatch("Address is invalid, it might contain a card number"), 1, 0)
| stats count AS "Total", count(eval(is_invalid=1)) as Failure
| eval result = (Failure * 100)/Total
---
If this reply helps you, Karma would be appreciated.
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something llke this

index="wpg" host=*pz-pay* OrderSummary
| eventstats count AS "Total"
| search "Address is invalid, it might contain a card number"
| stats count AS "Failure" values(Total) as Total
| eval result = (Total/Failure)*100
0 Karma
Get Updates on the Splunk Community!

Application management with Targeted Application Install for Victoria Experience

  Experience a new era of flexibility in managing your Splunk Cloud Platform apps! With Targeted Application ...

Index This | What goes up and never comes down?

January 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Splunkers, Pack Your Bags: Why Cisco Live EMEA is Your Next Big Destination

The Power of Two: Splunk + Cisco at "Ludicrous Scale"   You know Splunk. You know Cisco. But have you seen ...