Dashboards & Visualizations

How to build a multi-input dashboard and ignore inputs that are left blank?

Glasses
Builder

Hi 

I am trying to build a multi-input textbox dashboard based on a KVstore lookup.

My query is like this

 

| inputlookup <some-host-detail-kvlookup>
| search $computer_name$ OR $computer_number$ OR $computer_id$
| fields computerName computerNumber ComputerId ... 

 

each token has a prefix i.e. <fieldName> =  (which is the column header field in the lookup)

each token also has an initial value = null 

thus the query runs like this 

 

 

| search computerName=null OR computerNumber=null OR ComputerId=null

| search computerName=FOO  OR computerNumber=null OR ComputerId=null

 

 

as you can see setting  the <fieldName> to null allows the search to run without breaking, but after a user enters FOO for the computerName value, they need to reset the blank search inputs back to null.   Otherwise if a blank is passed like 

 

| search computerName= OR computerNumber=null OR ComputerId=null

 

the search breaks.

 

Any suggestions how to ignore the empty inputs or a way to reset the initial values to null again is greatly appreciated.  OR if anyone has a suggestion to do this another way, I would very much like to hear.

Thank you

0 Karma
Get Updates on the Splunk Community!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...