Splunk Enterprise

How could I show the value in my data in the drop down?

Questioner
Path Finder

I want to show the drop down value automatically about data name "landing_time".

So I wrote my code like this.

| eval st_time= round(landing_time,0)
| where st_time<=90
| stats values by st_time
| sort st_time

 But it show all landing_time less than 90, not fil the landing_time. For example..

lading_time : 7, 15, 17, 24, 30..
drop down data show : 0, 1, 2, 3, 4, .......17, 18, 19,....30, 31...

 How could I show only landing_time in the drop down?

Tags (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Change you fieldForLabel and fieldForValue attributes

   <fieldForLabel>st_time</fieldForLabel>
   <fieldForValue>st_time</fieldForValue>

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please share your dashboard source code in a code block

0 Karma

Questioner
Path Finder

This is my code about the drop down

<input type="dropdown" token="start_time" searchWhenChanged="true">
<label>First IR init Time (sec)</label>
<fieldForLabel>start_time</fieldForLabel>
<fieldForValue>start_time</fieldForValue>
<search>
<query>index=idx_ptd_dataset sourcetype="type:ptd_dataset:data" corp="flight"
| where !isnull(location)
| where !isnull(landing_time)
| eval st_time= round(landing_time,0)
| where st_time &lt;=90
| stats values by st_time
| sort st_time</query>
</search>
<default>ALL</default>
<choice value="ALL">ALL</choice>
</input>

 

 



 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Change you fieldForLabel and fieldForValue attributes

   <fieldForLabel>st_time</fieldForLabel>
   <fieldForValue>st_time</fieldForValue>
0 Karma

Questioner
Path Finder

Thank you for you help!
It work!!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...