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
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...