Splunk Search

Is it possible to populate values and pass to a search pipeline based on a lookup value? (Without using JS)

esix_splunk
Splunk Employee
Splunk Employee

I'd like to have a simple XML dropdown that selects, as an example a Device Name.

deviceName,Vendor,Model
mainfw,Cisco,asa5510
branch1,Cisco,asa5505
branch2,Cisco,asa5505

So when the user selects the deviceName from the drop down and all the variables (or select variables in the lookup) will be passed to the search pipeline :

index=blah deviceName=$deviceName$ vendor=$Vendor$ model=$Model$

I can do this currently with auto-populating searches and selectFirstChoice in the input. However, there are some issues with this, such as when the user changes the inputs, if the nested values are wrong then the search wont populate properly.

I'm wondering if there is a way to do this in 6.3 or 6.4 without:

1) Using JS
2) Exposing the additional drop down / input selects to the end user..

TIA

0 Karma

ziegfried
Influencer

Yeah, this is actually possible use a <change> event handler on the form input. Here's an example:

<input type="dropdown" token="country_code">
  <search>
    <query>| inputlookup geo_attr_countries.csv</query>
  </search>
  <fieldForLabel>country</fieldForLabel>
  <fieldForValue>iso3</fieldForValue>
  <change>
    <set token="continent">$row.continent$</set>
  </change>
</input>

In this example a token called $continent$ is set on every change of the form input and the value is taken from the same row of the search result (in this case the continent field).

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...