Splunk Search

Dropdown Not Populating

CannonT
Engager

I'm trying to populate a dropdown box with this search which returns the values I would expect, but the dropdown is not populating. I have also tried using inputlookup to populate directly from the csv to no avail.

index=test_index sourcetype=recipients OR sourcetype=opened OR sourcetype=submitted  
    | lookup list.csv identity AS userID OUTPUT bunit as bunit company AS Location  
    | rename FN as "First Name" LN as "Last Name" 
    | lookup BusinessUnit.csv bunit AS bunit OUTPUT "Corporate Division" AS "cdiv" 
    | stats count by cdiv

This is my dropdown

<input type="dropdown" token="Corporate Division">
      <label>Coporate Division Selection</label>
      <selectFirstChoice>true</selectFirstChoice>
      <populatingSearch fieldForLabel="Coporate Division" fieldForValue="Coporate Division">
      <![CDATA[index=test_index sourcetype=recipients OR sourcetype=opened OR sourcetype=submitted | lookup list.csv identity AS userID OUTPUT bunit as bunit company AS Location | rename FN as "First Name" LN as "Last Name" | lookup BusinessUnit.csv bunit AS bunit OUTPUT "Corporate Division" AS "cdiv" | stats count by cdiv]]>
      </populatingSearch>
      <choice value="*" selected="true">All Division</choice>
      <default>*</default>
    </input>
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

From your search query, the output fields are "count" and "cdiv" only (after stats) and you're trying to use the fields "Coporate Division" in the dropdown, which doesn't exists. Try using the field name "cdiv" in the dropdown properties (fieldForLabel and fieldForValue).

<input type="dropdown" token="Corporate Division">
      <label>Coporate Division Selection</label>
      <selectFirstChoice>true</selectFirstChoice>
      <populatingSearch fieldForLabel="cdiv" fieldForValue="cdiv">
      <![CDATA[index=test_index sourcetype=recipients OR sourcetype=opened OR sourcetype=submitted | lookup list.csv identity AS userID OUTPUT bunit as bunit company AS Location | rename FN as "First Name" LN as "Last Name" | lookup BusinessUnit.csv bunit AS bunit OUTPUT "Corporate Division" AS "cdiv" | stats count by cdiv]]>
      </populatingSearch>
      <choice value="*" selected="true">All Division</choice>
      <default>*</default>
    </input>

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

From your search query, the output fields are "count" and "cdiv" only (after stats) and you're trying to use the fields "Coporate Division" in the dropdown, which doesn't exists. Try using the field name "cdiv" in the dropdown properties (fieldForLabel and fieldForValue).

<input type="dropdown" token="Corporate Division">
      <label>Coporate Division Selection</label>
      <selectFirstChoice>true</selectFirstChoice>
      <populatingSearch fieldForLabel="cdiv" fieldForValue="cdiv">
      <![CDATA[index=test_index sourcetype=recipients OR sourcetype=opened OR sourcetype=submitted | lookup list.csv identity AS userID OUTPUT bunit as bunit company AS Location | rename FN as "First Name" LN as "Last Name" | lookup BusinessUnit.csv bunit AS bunit OUTPUT "Corporate Division" AS "cdiv" | stats count by cdiv]]>
      </populatingSearch>
      <choice value="*" selected="true">All Division</choice>
      <default>*</default>
    </input>
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 ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...