Dashboards & Visualizations

NOT text input in Splunk dashboard

ak0252
New Member

I am trying to create a text input in splunk dashboard that should ignore the ticket numbers entered by the user in the text box while running the query and If user doesn't input anything in that text box then by default it should search all tickets.

I tried a few ways to achieve this through eval, makeresults, etc. but no luck in getting it to work.

Any ideas on how can i achieve this functionality ?

<form version="1.1" theme="light">
<label>TEST</label>
<search id="tickets">
<query> index=tickets earliest=-1d latest=now
| eval search_ticket=if(len("$ticket_number$")=0, "ticket_number=*", "NOT ticket_number IN ($ticket_number$)")
</query>
</search>
<fieldset submitButton="true" autoRun="false">
<input type="text" token="ticket_number">
<label>ticket_number</label>
</input>
<row>
<panel>
<table>
<title>Results</title>
<search base="tickets">
<query>| search $search_ticket$|table ticket_number</query>
</search>
</table>
</panel>
</row>
</form>
Labels (2)
0 Karma

ak0252
New Member

i was able to achieve this using 

return $search_ticket

 

Thanks.

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!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...