All Apps and Add-ons

Override downstream autoRun?

ftk
Motivator

I have several dashboards that I use the Sideview Utils Pulldown module on. The pulldowns grab a list of industries and customers out of our customer data, and then pass these values on to downstream searches. This works all without a problem, however when the Pulldowns are populated, they kick off the downstream searches automatically, causing all downstream searches to display data for All customers on page load.

What I want them to do is load the pulldown values on page load, but not autoRun the searches downstream -- I want a submit button or similar so I can first select my desired pulldown combination before kicking off the downstream searches. I have tried SubmitButton and different autoRun=true/false combinations to no avail.

Dashboard code:

<view autoCancelInterval="90" isVisible="true" onunloadCancelJobs="true" template="dashboard.html" isSticky="False">
    <label>My label</label>
    <module name="AccountBar" layoutPanel="appHeader" />
    <module name="AppBar" layoutPanel="appHeader" />
    <module name="SideviewUtils" layoutPanel="appHeader" />

    <module name="Message" layoutPanel="messaging">
    <param name="filter">splunk.search.error</param>
    <param name="maxSize">1</param>
    <param name="clearOnJobDispatch">False</param>
    </module>

    <module name="TitleBar" layoutPanel="viewHeader">
        <param name="actionsMenuFilter">dashboard</param>
    </module>

    <module name="Search" layoutPanel="panel_row1_col1" group="" autoRun="true">
        <param name="search">| inputlookup host_customer_lookup | where host!="" | dedup industry | fields industry</param>
        <param name="earliest">-60d@d</param>
        <param name="latest">now</param>

        <module name="Pulldown">
            <param name="searchFieldsToDisplay">
                <list>
                  <param name="value">industry</param>
                  <param name="label">Industry</param>
                </list>
            </param>
            <param name="name">selectedIndustry</param>
            <param name="label">Industry</param>

            <module name="Search" layoutPanel="panel_row1_col1" group="" autoRun="true">
                <param name="search">| inputlookup host_customer_lookup | where host!="" | search industry="$selectedIndustry$" | dedup customer | fields customer</param>
                <param name="earliest">-60d@d</param>
                <param name="latest">now</param>
                <module name="Pulldown">
                    <param name="searchFieldsToDisplay">
                        <list>
                          <param name="value">customer</param>
                          <param name="label">Customer</param>
                        </list>
                    </param>
                    <param name="name">selectedCustomer</param>
                    <param name="label">Customer</param>

                    <module name="TimeRangePicker">
                        <param name="default">-60d@d</param>

                        <module name="Search" layoutPanel="panel_row2_col1" group="" autoRun="false">
                            <param name="search">some search industry="$selectedIndustry$" customer="$selectedCustomer$" | timechart avg(somevalue) by customer</param>
                            <module name="HiddenChartFormatter">
                                <param name="chart">line</param>
                                <param name="legend.placement">right</param>
                                <param name="chart.nullValueMode">zero</param>
                                <param name="primaryAxisTitle.text">Time</param>
                                <param name="secondaryAxisTitle.text">Hours Mined</param>
                                <module name="JSChart">
                                    <param name="width">100%</param>
                                </module>
                            </module>
                        </module>
                    </module>
                    <!-- end timepicker-->
                    <module name="Search" layoutPanel="panel_row3_col1" group="" autoRun="false">
                        <param name="search">some otgher search  industry="$selectedIndustry$" customer="$selectedCustomer$" </param>
                            <module name="SimpleResultsTable">
                                <param name="count">30</param>
                                <param name="displayRowNumbers">False</param>
                                <param name="drilldown">none</param>
                            </module>
                    </module>

                </module>
            </module>
        </module>
    </module>

</view>
1 Solution

sideview
SplunkTrust
SplunkTrust

You may get some mileage out of the Button module. Button is much like Splunk's SubmitButton module, except that a) it has an "allowAutoSubmit" param that does something pretty close to what you're looking for here, b) it allows a "customBehavior" to be attached to it, like any other Sideview module. c) The code was written from scratch so it's cleaner and simpler than SubmitButton and has less going on.

So.

1) Add a Button module after your controls,
2) give it allowAutoSubmit False

That will get you most of the way there. (I still recommend setting allowSoftSubmit to "True", despite the allowAutoSubmit "False".)

However at a practical level there's always some confusion that you have to clean up. This is because when the page loads, the interface elements below the button "sort of" load when the page loads. Some things will be visible, some wont. Often the page looks broken overall and nothing "inhibits user interaction" quite like borkedness.

What I have done in these situations is use the app's CSS to make certain div containers invisible in that view on page load, and then put a CustomBehavior module downstream from the SubmitButton, and onContextChange within that customBehavior, make those div containers visible using jquery.

PS. Actually I lied, what I do is put a customBehavior param on the Button itself, but this is more advanced -- definitely if you're not really used to customBehaviors and not really familiar with the module framework methods, use the flavorless CustomBehavior module and stay away from trying to tinker with an existing module's methods in vivo.

View solution in original post

sideview
SplunkTrust
SplunkTrust

You may get some mileage out of the Button module. Button is much like Splunk's SubmitButton module, except that a) it has an "allowAutoSubmit" param that does something pretty close to what you're looking for here, b) it allows a "customBehavior" to be attached to it, like any other Sideview module. c) The code was written from scratch so it's cleaner and simpler than SubmitButton and has less going on.

So.

1) Add a Button module after your controls,
2) give it allowAutoSubmit False

That will get you most of the way there. (I still recommend setting allowSoftSubmit to "True", despite the allowAutoSubmit "False".)

However at a practical level there's always some confusion that you have to clean up. This is because when the page loads, the interface elements below the button "sort of" load when the page loads. Some things will be visible, some wont. Often the page looks broken overall and nothing "inhibits user interaction" quite like borkedness.

What I have done in these situations is use the app's CSS to make certain div containers invisible in that view on page load, and then put a CustomBehavior module downstream from the SubmitButton, and onContextChange within that customBehavior, make those div containers visible using jquery.

PS. Actually I lied, what I do is put a customBehavior param on the Button itself, but this is more advanced -- definitely if you're not really used to customBehaviors and not really familiar with the module framework methods, use the flavorless CustomBehavior module and stay away from trying to tinker with an existing module's methods in vivo.

SarahBOA
Path Finder

I was unable to upload to pastebin (site is blocked for me), so I opened a new splunk-base question at: http://splunk-base.splunk.com/answers/66080/sideview-pulldown-having-downstream-effect Thanks!

0 Karma

sideview
SplunkTrust
SplunkTrust

Well, I may be missing something but let me explain more. At any point in the view hierarchy, there can only be one search, be it dispatched or not. So the JobStatus module can either be located in the hierarchy such that it shows progress for the main search, or so that it shows progress for the search feeding one of the Pulldowns, but not both. Maybe can you post your updated XML in pastebin?

0 Karma

SarahBOA
Path Finder

Not quite sure either of those will work:
1. Downstream - Issue is that I need the values from the pulldowns in the main search. So if my understanding of upstream/downstream is correct, I have to have the main search downstream of the pulldowns (using SV Search module) and then the JobStatus downstream of the search...which means it will always be downstream of the pulldowns as well and will show their loading searches.
2. Using SearchControls - one of the pieces of the JobStatus module that I want to see is the progress indicator so the user knows when the search starts and completes.

0 Karma

sideview
SplunkTrust
SplunkTrust

No, but you can reorder the modules so that the JobStatus module is downstream from the point where it's picking up the unwanted search. That's one way. Another way is to use the Sideview SearchControls module, which is designed to replace JobStatus, is a lot more flexible to configure, and which doesn't actually have any embedded progress indication. There's a docs page in latest utils about SearchControls that you can check out.

0 Karma

SarahBOA
Path Finder

This worked wonderfully to stop the AutoSubmit issues! I will add a secondary issue though; my JobStatus module still shows the loading of my pulldowns. So I see it go back and forth between 0% and 100% several times (and no results populate the table as I have the AutoSubmitturned off so the final search isn't run). Is there anyway to make the jobstatus module only run when the Button is pressed? I have AutoRun="true" on the first pulldown, then several more pulldowns and textfields then I have a timePicker with Button, then Search, then JobStatus module all nested.

0 Karma

sideview
SplunkTrust
SplunkTrust

Sorry I should have been clear -- I didn't recommend allowSoftSubmit True because there was any weird interaction with allowAutoSubmit. I just recommend allowSoftSubmit True because it's more of a standard across Splunk apps, and if you hit a user who's only used apps where it's set to True, they sometimes think that the UI is broken when the results never appear, and they never think to click the green button. Feel free to set allowSoftSubmit to whatever you like -- it will have no effect on allowAutoSubmit and the two params do separate things and function independently.

0 Karma

ftk
Motivator

Hey Nick, thanks for the pointers. Button did indeed work, however I had to put both allowAutoSubmit and allowSoftSubmit to false. Setting allowSoftSubmit to false didn't garble the dashboard up in my case, all charts are invisible, works for me. Thanks!

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 ...