Dashboards & Visualizations

Splunk DB Connect: How to create a form input on a dashboard to search a SQL query?

lrolfes
Engager

Hello Splunk Community,

I am probably a 3 out of 10 when it comes to Splunk knowledge. I have connected my database with the DB connect app. I would like to create an app with a form that searches this SQL query:

SELECT to_jid, sent_date, subject, thread_id, msg_type, direction, body_len, message_len, 
body_string, message_string, body_text, message_text, history_flag 
FROM jm 
WHERE from_jid like 'bob@cisco.com%'; 

I would like the user to be able to update the where clause with just an input box because the users do not know SQL so I want to hide that from them.

So basically they open the app > enter a name in the textbox > splunk searches the database and returns the results to the user.

Would anyone have a quick example of doing this?

I appreciate your help!

0 Karma
1 Solution

bandit
Motivator

After creating a dashboard, go into the edit mode and add a text input. It will default to field1. You can reference it as token/variable in another search in your dashboard. i.e. index=my_index $field1$.

View solution in original post

bandit
Motivator

After creating a dashboard, go into the edit mode and add a text input. It will default to field1. You can reference it as token/variable in another search in your dashboard. i.e. index=my_index $field1$.

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...