Dashboards & Visualizations

how to fulfill a drop-down list automtically

jip31
Motivator

hello

I want to know if its possible to fullfill a drop down list automatically?
I want to retrieve the field SITE in my drop down list

| inputlookup x.csv| lookup x.csv HOSTNAME as host output SITE

another question
when I add a field manually, if there is a space in the field I cant use it
for example, in the static option if I add a name field like "toto - tutu" and I put the same name in the value field I have no results for this field even if the name if correct
I am obliged to do "toto*" in the value field for having results but its not correct because I have to use the exact name
what can I do please??

thanks

Tags (1)
0 Karma
1 Solution

VatsalJagani
SplunkTrust
SplunkTrust

Hi @jip31,

I think these steps might help.

  • Edit your dashboard
  • Add an Input (Drop-down)
  • Edit the input
  • Give token name
  • Scroll down to "Dynamic Options"
  • Paste your search there ( | inputlookup x.csv)
  • Field For Label - Give SITE
  • Field For Value - Give value SITE
  • Apply
  • Save the dashboard

For your second question where you have some value with spaces. You can search that in your search like: | search field=$your_dropdown_token_name|s$
Basically, |s will add quotes on both side as well as if your value itself contents quotes this will escape those. Hence you will be able to search full value.
Hope this helps!!!

View solution in original post

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

Hi @jip31,

I think these steps might help.

  • Edit your dashboard
  • Add an Input (Drop-down)
  • Edit the input
  • Give token name
  • Scroll down to "Dynamic Options"
  • Paste your search there ( | inputlookup x.csv)
  • Field For Label - Give SITE
  • Field For Value - Give value SITE
  • Apply
  • Save the dashboard

For your second question where you have some value with spaces. You can search that in your search like: | search field=$your_dropdown_token_name|s$
Basically, |s will add quotes on both side as well as if your value itself contents quotes this will escape those. Hence you will be able to search full value.
Hope this helps!!!

0 Karma

jip31
Motivator

perfect all is working!

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...