All Apps and Add-ons

Sideview Utils: How to add a button to submit values for two form inputs and run a search?

pwndsnake
New Member

I've checked the other answers on this site, including the ones referencing SideView Utils and adding a button to each table event, however, I think I'm looking for something else.

I have two input fields on my dashboard. I want to be able to enter text into both fields, then either click a button on the dashboard (this is preferred) or click a link that will take both inputs and append a custom command to the end of it, then submit it.

So, for example, I have a form with a field for email address, and then a field for subject. I want to be able to take those two form inputs, then append | sendemail $address $subject to it, then the link/button will run that search.

Hopefully that is enough information to go off of, but, please let me know if I can provide more details.

0 Karma

sideview
SplunkTrust
SplunkTrust

Well this is pretty straightforward in Sideview Utils, but you can also do this without much trouble just using the default Splunk Dashboard editor.

Here's how to do it in hand-edited Sideview XML.

<module name="TextField" layoutPanel="panel_row1_col1">
  <param name="name">to</param>
  <param name="label">to:</param>

  <module name="TextField">
    <param name="name">subject</param>
    <param name="label">subject:</param>

    <module name="Button">
      <param name="allowSoftSubmit">True</param>

      <module name="Search">
        <param name="search">foo | sendemail $address$ $subject$ </param>

        <module name="JobProgressIndicator"></module>
      </module>
    </module>
  </module>
</module>

If you're using the Sideview Editor you would click and edit your way to the above hierarchy.
Be sure to read the first few introductory documentation pages within the Sideview Utils app, and then also read the TextField docs and examples page. That'll give you enough to understand this simple view, and then you can expand out to the other UI modules and their docs and examples pages.

But again, in this (really very simple) use case you can also just use core Splunk UI features - in brief, add a search to a dashboard panel, edit the panel, and then click "add input", and read a bunch of Splunk docs about how to then parametrize your search with $foo$ tokens.

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...