Splunk Search

How do I use eval with two searches and format the result as a Single Value?

rafasalo
Engager

Hi,

I've done a search that uses eval with two searches to get the final result. Then, I'm trying to see the result as a Single Value, however, as the Single Value uses the first column and my the final result is set on the third one, I can't.

See my search below and the table that results from it.

index= "index_cbo_pt" "AcquirerResponseCode=0" | stats count as Result1 | appendcols [search index= "index_cbo_pt" "AcquirerResponseCode=0" | stats dc(MerchantCheckoutId) as Result2] | eval finalValue = Result1/Result2

alt text

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If you need all three values, try re-ordering them by adding | table finalValue Result1 Result2 to your query.

If you only need finalValue, try appending | fields finalValue or | table finalValue to your query.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

If you need all three values, try re-ordering them by adding | table finalValue Result1 Result2 to your query.

If you only need finalValue, try appending | fields finalValue or | table finalValue to your query.

---
If this reply helps you, Karma would be appreciated.

rafasalo
Engager

Thank you very much!

I was thinking about using the result with timechart, could you help me?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Possibly, but for the benefit of future readers, you should submit a new question.

---
If this reply helps you, Karma would be appreciated.
0 Karma

rafasalo
Engager
0 Karma

rafasalo
Engager

Ok. I was doing it, however, as I just have 22 points I need to wait until tomorrow. It just doesn't make sense...

0 Karma
Get Updates on the Splunk Community!

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...