Knowledge Management

Extract values from column 1 of table based on value in column 2

adityagarg
New Member

I have a table which shows the model name along with their r-squared values. I want to extract the model name corresponding to the highest r-squared value. I want to use this model name to use this model for further analysis purposes. Below is the snip of the tablealt text

From the table above, I am expecting to store "RF_Prediction" in another variable where I can use that in "IF" command

Tags (1)
0 Karma

somesoni2
Revered Legend

Other option would be:

your current search  | sort 1 -r_squared
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@adityagarg

Try this:

YOUR_SEARCH | eventstats max(r_squared) as max_r_squared | where r_squared=max_r_squared

This will give you model name corresponding to the highest r-squared value.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...