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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...