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.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...