Splunk Search

How to edit my XML and search query to automatically populate a drop-down menu?

PabloBonilha
Explorer

Hello, I'm trying to use the xml below to automatically populate a dropdown menu, but any result is returned and the page remains only as "loading...". Please can someone help me improve this query or correct if wrong? Thanks.

    <input type="dropdown" token="customer">
        <choice value="*">All</choice>
        <populatingSearch fieldForValue="customer" fieldForLabel="customer"><![CDATA[ index="my_index" | dedup customerID | stats count by customerID | sort -customerID | table customerID | rename customerID AS customer ]]></populatingSearch>
    </input>

<!-- SELECT CUSTOMER OPERATION -->
    <input type="dropdown" token="operation">
        <choice value="*">All</choice>
        <populatingSearch fieldForValue="operation" fieldForLabel="operation"><![CDATA[ index="my_index" | dedup operationID | stats count by operationID | sort -operationID | table operationID | rename operationID AS operation ]]></populatingSearch>
    </input>
Tags (3)
0 Karma

btt
Path Finder

Hi, if you have "loading" in your page then, it is not a populate search the problem if not you should have "could not populate the search". Could you send all your xml source code?

0 Karma

jitsinha
Path Finder

As per my understading all you want is to populate dropdowns with customerID and operationID. In that case using stats command makes no sense.

Modified query 1: index="my_index" | table customerID | dedup customerID | sort -customerID | rename customerID AS customer

Modified query 2: index="my_index" | table operationID | dedup operationID | sort -operationID | rename operationID AS operation

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...