Dashboards & Visualizations

How to fetch value of column in Splunk table?

ktanwar
Explorer

Hi all,

So lets suppose I have the following table:

Job_ID  Parameter_A  Parameter_B

1                   "Car"                     "Red"

2                    "Bus"                    "Blue"

 

I want to get value "Red" and use it in an eval function. How to do it? Thanks!

 

@bowesmana calling you for help like always!!!

Labels (4)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

In that table, it looks like you have two rows, each with 3 fields. The field 'Parameter_B' contains the value "Red" for row 1, so as @richgalloway says, you just use Parameter_B field in the eval statement.

 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Field values are always referenced by the field name, "Parameter_B" in this case.  By saying | eval foo=Parameter_B you give the 'foo' field the value "Red" or "Blue".   To only set foo to "Red", use a conditional.

| eval foo=if(Parameter_B="Red", Parameter_B, null())

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...