All Apps and Add-ons

What is the purpose of fieldforLabel attribute?

rroberts
Splunk Employee
Splunk Employee

Ive changed the value for fieldforLabel attribute on the populatingSearch element to something arbitrary and it seems to make no difference. What does this attribute actually do? It is listed as mandatory in the XML reference docs.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

If you are configuring an input like dropdown/checkbox, the fieldforValue defines which field value from the pupulatingSearch result will be used as token value and the fieldforLabel define which field value from the popultingSearch result will be used to display in the UI. E.g. showing label "All" in dropdown and using "*" as token value.
I tested with Splunk 5.0.5 and it doesn't work if the fieldforLabel column is not present in the result. What Splunk version you're using?

strive
Influencer

It is used to display Label names. Say for example Names in a dropdown.

  <fieldset>
      <input type="dropdown" token="host" searchWhenChanged="true">
          <label>Host:</label>
          <default>SomeValue</default>
          <populatingSearch fieldForValue="host" fieldForLabel="host">| metadata type=hosts                                        index=os</populatingSearch>
          <choice value="*">all</choice>
       </input>
0 Karma

strive
Influencer

The fieldForLabel and fieldForValue should be in resultset of your search.
Hope this will help you http://answers.splunk.com/answers/151189/how-can-i-get-the-current-time-in-hhmmss-as-the-default-val...

0 Karma

rroberts
Splunk Employee
Splunk Employee

I tried something similar but saw no difference.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...