Dashboards & Visualizations

How to display table headers based on form input?

john_dagostino
Path Finder

I'm looking for a way to display a table based on a dropdown input in a dashboard. For example, if I choose "ASA" as the sourcetype, I want the table to only display the fields _time, host, src dest but if I choose "Infoblox" then I want the table to display _time, dhcpresponse, dnsquery, etc. Is there a way to do this in simple XML?

0 Karma
1 Solution

woodcock
Esteemed Legend

Do it like this:

<fieldset>
<input type="dropdown" token="fields_by_sourcetype_token">
  <label>Fields by Sourcetype</label>
  <choice value="_time host src dest ">ASA</choice>
  <choice value="_time dhcpresponse dnsquery">Infoblox</choice>
  <default>ASA</default>
</input>

Then do this:

<searchString>Blah BLAH BlAh | table $fields_by_sourcetype_token$</searchString>

View solution in original post

0 Karma

woodcock
Esteemed Legend

Do it like this:

<fieldset>
<input type="dropdown" token="fields_by_sourcetype_token">
  <label>Fields by Sourcetype</label>
  <choice value="_time host src dest ">ASA</choice>
  <choice value="_time dhcpresponse dnsquery">Infoblox</choice>
  <default>ASA</default>
</input>

Then do this:

<searchString>Blah BLAH BlAh | table $fields_by_sourcetype_token$</searchString>
0 Karma

john_dagostino
Path Finder

You rock!

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...