All Apps and Add-ons

Sideview Pulldown having Downstream effect

SarahBOA
Path Finder

I have several Sideview Utils Pulldowns on my page. A few are filled by static options, one is filled by a HiddenSavedSearch and two are done using PostProcess. Each value that is chosen in the drill down is used within a search that populates a chart or grid. I have two behaviors going on that I would like to correct:

  1. Every change of a value on a pulldown causes all pulldowns whose values are filled using a search to reload (includes the pulldowns that run a saved search and the ones that are running post process). (e.g., with code below: if I change the selected value on my Category Pulldown, the Application Sub-Application and Pipeline pulldowns are reloaded as well).
  2. Every load or reload of a drop down list causes the job status module to show the search running. I only want the job status module to run when the submit button is clicked and the final search, which uses the pulldown values, is run. (e.g., with code below, when the search that populates the Application pulldown runs, it shows as running in the JobStatus module as well)

Thanks,
Sarah

<view autoCancelInterval="120" isPersistable="true" isSticky="true" isVisible="true" objectMode="SimpleForm" onunloadCancelJobs="false" template="dashboard.html">
  <label>OS Category</label>
  <module name="AccountBar" layoutPanel="appHeader"/>
  <module name="AppBar" layoutPanel="navigationHeader"/>
  <module name="SideviewUtils" layoutPanel="appHeader"/>

  <!-- COMMENTED OUT. MAY NEED TO UNCOMMENT FOR DEVELOPMENT 
  <module name="Message" layoutPanel="messaging">
    <param name="filter">*</param>
    <param name="clearOnJobDispatch">False</param>
    <param name="maxSize">1</param>
  </module>
  -->
  <module name="StaticContentSample" layoutPanel="viewHeader">
    <param name="text">&lt;h2&gt;OS Category&lt;/h2&gt;</param>
  </module>
  <module name="Pulldown" layoutPanel="mainSearchControls">
    <param name="name">CATEGORY</param>
    <param name="label">Category</param>
    <param name="float">left</param>
    <param name="staticOptions">
      <list><param name="label">*</param><param name="value">*</param></list>
      <list><param name="label">CRITICAL</param><param name="value">CRITICAL</param></list>
      <list><param name="label">ERROR</param><param name="value">ERROR</param></list>
    </param>
    <module name="Pulldown">
      <param name="name">DATACENTER</param>
      <param name="label">Location</param>
      <param name="float">left</param>
      <param name="staticOptions">
        <list><param name="label">*</param><param name="value">*</param></list>
        <list><param name="label">AZ</param><param name="value">AZ</param></list>
        <list><param name="label">NJ</param><param name="value">CA</param></list>
      </param>
      <module name="Pulldown">
        <param name="name">POD</param>
        <param name="label">Pod</param>
        <param name="float">left</param>
        <param name="staticOptions">
          <list><param name="label">*</param><param name="value">*</param></list>
          <list><param name="label">POD1</param><param name="value">POD1</param></list>
          <list><param name="label">POD2</param><param name="value">POD2</param></list>
        </param>
        <module name="Pulldown">
          <param name="name">SLICE</param>
          <param name="label">Slice</param>
          <param name="float">left</param>
          <param name="staticOptions">
            <list><param name="label">*</param><param name="value">*</param></list>
            <list><param name="label">SLICE1</param><param name="value">SLICE1</param></list>
            <list><param name="label">SLICE2</param><param name="value">SLICE2</param></list>        
            <list><param name="label">SLICE3</param><param name="value">SLICE3</param></list>        
            <list><param name="label">SLICE4</param><param name="value">SLICE4</param></list>                            
          </param>
          <module name="Pulldown">
            <param name="name">PLATFORM</param>
            <param name="label">Platform</param>
            <param name="float">left</param>
            <param name="staticOptions">
              <list><param name="label">*</param><param name="value">*</param></list>
              <list><param name="label">Windows</param><param name="value">Borneo</param></list>            
              <list><param name="label">Linux</param><param name="value">NGEN</param></list>            
              <list><param name="label">Mac</param><param name="value">NextGen</param></list>
            </param>
            <module name="HiddenSavedSearch" layoutPanel="mainSearchControls" autoRun="true">
              <param name="savedSearch">get_errvol_applications</param>
              <module name="Pulldown">
                <param name="name">APP</param>
                <param name="label">Application</param>
                <param name="float">left</param>
                <param name="staticFieldsToDisplay"></param>
                <param name="postProcess">search PLATFORM="$PLATFORM$" | fields APP | dedup APP | eval temp=lower(APP) | appendpipe [ head 1 | eval APP="*" | eval temp="*"] | sort temp | fields APP </param>
                <param name="valueField">$name$</param>
                <module name="Pulldown">
                  <param name="name">PIPELINE</param>
                  <param name="label">Pipeline</param>
                  <param name="float">left</param>
                  <param name="staticFieldsToDisplay"></param>
                  <param name="postProcess">search PLATFORM="$PLATFORM$"APP=$APP$ | fields PIPELINE | dedup PIPELINE | appendpipe [ head 1 | eval PIPELINE="*" ]| sort PIPELINE</param>
                  <param name="valueField">$name$</param>
                  <module name="HiddenSavedSearch" layoutPanel="mainSearchControls">
                    <param name="savedSearch">get_errvol_subapps</param>
                    <module name="Pulldown">
                      <param name="name">SUBAPP</param>
                      <param name="label">Sub-Application</param>
                      <param name="float">left</param>
                      <param name="staticFieldsToDisplay"></param>
                      <param name="searchFieldsToDisplay">
                        <list>
                          <param name="label">SUBAPP</param>
                          <param name="value">SUBAPP</param>
                        </list>
                      </param>
                      <module name="Pulldown" layoutPanel="mainSearchControls">
                        <param name="name">OPTION</param>
                        <param name="label">Options</param>
                        <param name="float">left</param>
                        <param name="staticOptions">
                          <list><param name="label">Office</param><param name="value">OFFICE</param></list>
                          <list><param name="label">Host</param><param name="value">orig_host</param></list>
                          <list><param name="label">Module</param><param name="value">MODULE</param></list>
                          <list><param name="label">Message Description</param><param name="value">MSG_DESC_SHORT</param></list>
                        </param>
                        <module name="TextField" layoutPanel="mainSearchControls">
                          <param name="name">OPTVALUE</param>
                          <param name="float">left</param>
                          <param name="label">Value</param>
                          <module name="AutoRefresh">
                            <param name="invervalInSeconds">300</param>
                            <module name="TimeRangePicker" layoutPanel="mainSearchControls">
                              <param name="searchWhenChanged">False</param>
                              <param name="selected">Last 15 Minutes</param>

                              <module name="Button">
                                <param name="allowSoftSubmit">False</param>
                                <param name="allowAutoSubmit">False</param>
                                <param name="label">Submit</param>
                                <module name="Search">
                                  <param name="search">index=summary_fivemin report="1min_OS" $OPTION$=$OPTVALUE$*
                NOT CATEGORY="----" APP=$APP$ PLATFORM="$PLATFORM$" DATACENTER=$DATACENTER$ CATEGORY=$CATEGORY$ PIPELINE=$PIPELINE$ SUBAPP=$SUBAPP$
                | eval orig_host=mvindex(split(orig_host, "."), 0) | lookup environment SERVERNAME as orig_host OUTPUT POD, SLICE | search POD=$POD$ SLICE=$SLICE$
                | stats sum(count) as COUNT, CATEGORY APP MSG_DESC_SHORT
                | table COUNT CATEGORY APP MSG_DESC_SHORT</param>
                                  <module name="JobStatus">
                                    <param name="resultsLink">
                                      <param name="popup">True</param>
                                      <param name="viewTarget">report_builder_define_data</param>
                                      <param name="transformedResultsViewTarget">report_builder_format_report</param>
                                    </param>
                                    <module name="Paginator" layoutPanel="panel_row2_col1">
                                      <param name="entityName">results</param>
                                      <module name="SimpleResultsTable" layoutPanel="panel_row2_col1">
                                        <param name="fields">COUNT, CATEGORY, APP, MSG_DESC_SHORT</param>
                                        <param name="entityName">results</param>
                                        <param name="drilldown">row</param>

                                        <module name="Search">
                                          <param name="search">`olIndex` sourcetype=app_list 
                                          | lookup errvol_modules COMPONENT_NAME OUTPUT MODULE | fields - eventtype | eval orig_host=host
                | fillnull value="----" PLATFORM APP CATEGORY DATACENTER PIPELINE JVM COMPONENT_NAME SUBAPP MODULE
                | eval MSG_DESC_SHORT=if(len(MSG_DESC)&gt;99,substr(MSG_DESC,1,100)+"...",MSG_DESC)
                | search $OPTION$=$OPTVALUE$* PLATFORM=$PLATFORM$ DATACENTER=$DATACENTER$ SUBAPP=$SUBAPP$ PIPELINE=$PIPELINE$ POD=$POD$ SLICE=$SLICE$ APP=$click.fields.APP$ CATEGORY=$click.fields.CATEGORY$ MSG_DESC_SHORT="$click.fields.MSG_DESC_SHORT$"</param>
                                          <module name="ConvertToDrilldownSearch">
                                            <module name="ViewRedirector">
                                              <param name="viewTarget">flashtimeline</param>
                                            </module>
                                          </module>
                                        </module>
                                      </module>
                                    </module>
                                  </module>
                                </module>
                              </module>
                            </module>
                          </module>
                        </module>
                      </module>
                    </module>
                  </module>
                </module>
              </module>
            </module>
          </module>
        </module>
      </module>
    </module>
  </module>
</view>

guilhem
Contributor

Hello there,

I am having the exact same problem (pulldown refresh after search), but I cannot use the solution given here (can't put the search upstream for several reasons).

Also the search dispatched upstream was different each time, so the "fix" done in 2.2.7 doesn't apply here.

I've managed to solved partly the problem using a little custom behavior, I put it here so that it may helps (and hopefully get corrected if needed).

Sideview.utils.declareCustomBehavior("refreshOnlyOnce", function(pulldownModule) {
 /**
 * If this returns true, then the Pulldown will be allowed to reload its
 * dynamic options onContextChange.   Pulled out as its own method so that 
 * it can be easily overridden by customBehavior.
 */
pulldownModule.allowReload = function() {
    return false;
}

The pulldown module will now reload only when page load, and never after.

BUT, it seems that the search is still dispatched, as the pulldown is not emptied and repopulated, but we can see the progress bar at the top of it, like if the search was run again. I woul like to prevent this to happen, so I have digged a little in the Pulldown.js module and found this:

/**
 * if the module is configured dynamically then we have to trigger 
 * a new dispatched search. Note that we actually defer to 
 * DispatchingModule to calculate it.
 */
requiresDispatch: function($super, context) {
    if (this.searchFields.length==0) return false;
    else return $super(context);
}

And I tried to set it to false but it doesn't seem to prevent the search from being run (or at least the loading bar still show up)

Is there a handy way to achieve this using custom behavior?

Thanks!

0 Karma

sideview
SplunkTrust
SplunkTrust

The Pulldown module, when configured dynamically, always reloads its dynamic options when it receives a change from above.

Leaving aside for the second whether it should have some mode that turns this behavior off, there are a number of things you can do to fix problem #1.

First, you can pull up the search, in this case your HiddenSavedSearch module, up to the top of the Pulldowns.

If you have:

<module name="HiddenSavedSearch" layoutPanel="mainSearchControls" autoRun="true">
  <param name="savedSearch">get_errvol_applications</param>

  <module name="CustomBehavior">
    <param name="requiresDispatch">True</param>

upstream from all of the Pulldowns, then that saved search will get run and loaded when the page loads, and the Pulldown changes will never cause it to reload.

Of course, you'll still have your second saved search embedded down there. Another idea that might work for you, is to combine these two savedsearches. Right now you have one that gives you unique combinations of Platform and App, and a second saved search that gives you the unique combinations of Platform, App and Pipeline. As such the first seems redundant... With a little postProcess (| dedup Platform app) you can get the unique combinations of Platform and App from the second saved search's results.

As such, you can have just the second SavedSearch way up at the top, then postProcess searches applied on your dynamic pulldowns so that your saved searches never get run when any pulldowns are changed. Of course the Pulldowns will still reload, but unless your system is bogged down the repopulation using only postprocess should happen almost instantly.

As to what's going on with problem #2, I'm not sure. It sounds strange. First of all, you have both allowSoftSubmit and allowAutoSubmit set to False on the Button module, meaning that no push should be able to pass that Button module until the user actually clicks on the green submit button. In other words until that green button is clicked, you shouldn't be seeing any activity from JobStatus or from your Table, etc..

Here's an example I put together using purely _internal date, where you can see 2 static Pulldowns, 2 dynamic Pulldowns and 2 more dynamic Pulldowns with multiple-selection.

Try it out. It has the same config you're using here, where allowSoftSubmit and allowAutoSubmit completely prevent the main search from running until the green button is pressed.

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

  <module name="Message" layoutPanel="messaging">
    <param name="filter">*</param>
    <param name="maxSize">2</param>
    <param name="clearOnJobDispatch">False</param>
  </module>

  <module name="Search" layoutPanel="panel_row1_col1" autoRun="True">
    <param name="search">index=_internal source="*metrics.log" group="per_*_thruput" | stats count by group series date_hour date_minute</param>

    <module name="TimeRangePicker">
      <param name="default">Last 7 days</param>

      <module name="Pulldown">
        <param name="name">group</param>
        <param name="label">Group</param>
        <param name="template">$name$="$value$"</param>
        <param name="valueField">$name$</param>
        <param name="postProcess">dedup $name$ | sort $name$</param>
        <param name="staticOptions"></param>
        <param name="float">left</param>

        <module name="Pulldown">
          <param name="name">series</param>
          <param name="label">Series</param>
          <param name="template">$name$="$value$"</param>
          <param name="valueField">$name$</param>
          <param name="postProcess">search $group$ | dedup $name$ | sort $name$</param>
          <param name="staticOptions"></param>

          <module name="Pulldown">
            <param name="name">date_hour</param>
            <param name="label">Hour of day</param>
            <param name="template">$name$="$value$"</param>
            <param name="valueField">$name$</param>
            <param name="postProcess">search $group$ $series$ | dedup $name$ | sort $name$</param>
            <param name="staticOptions"></param>
            <param name="size">5</param>
            <param name="outerTemplate">( $value$ )</param>
            <param name="separator">+OR+</param>
            <param name="float">left</param>

            <module name="Pulldown">
              <param name="name">date_minute</param>
              <param name="label">Minute of hour</param>
              <param name="template">$name$="$value$"</param>
              <param name="valueField">$name$</param>
              <param name="postProcess">search $group$ $series$ $date_hour$ | dedup $name$ | sort $name$</param>
              <param name="staticOptions"></param>
              <param name="size">5</param>
              <param name="outerTemplate">( $value$ )</param>
              <param name="separator">+OR+</param>

              <module name="Pulldown">
                <param name="name">stat</param>
                <param name="label">Chart the</param>
                <param name="float">left</param>
                <param name="staticOptions">
                  <list>
                    <param name="label">distinct count of</param>
                    <param name="value">dc</param>
                  </list>
                  <list>
                    <param name="label">average</param>
                    <param name="value">avg</param>
                  </list>
                  <list>
                    <param name="label">max</param>
                    <param name="value">max</param>
                  </list>
                  <list>
                    <param name="label">min</param>
                    <param name="value">min</param>
                  </list>
                  <list>
                    <param name="label">sum</param>
                    <param name="value">sum</param>
                  </list>
                </param>

                <module name="Pulldown">
                  <param name="name">field</param>
                  <param name="staticOptions">
                    <list>
                      <param name="value">eps</param>
                    </list>
                    <list>
                      <param name="value">kb</param>
                    </list>
                    <list>
                      <param name="value">kbps</param>
                    </list>
                  </param>

                  <module name="Search">
                    <param name="search">index=_internal source="*metrics.log" $group$ $series$ $date_hour$ $date_minute$ | stats $stat$($field$) by series</param>

                    <module name="Button">
                      <param name="allowSoftSubmit">False</param>
                      <param name="allowAutoSubmit">False</param>

                      <module name="SearchControls"></module>

                      <module name="Pager">

                        <module name="Table"></module>
                      </module>
                    </module>
                  </module>
                </module>

              </module>

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

</view>

Coming all the way back to the idea of adding a param to Pulldown called like "reloadOnUpstreamChange", I've been thinking about adding this and I just haven't yet. And helping to stay my hand is the fact that so far I've always been able to look at the forms a bit differently, and either dispatch the search further upstream (as in my suggestion), or build the pulldowns from postprocess or from inputlookup so they load effectively instantly.

Update on this last point (re: reloadOnUpstreamChange). In 2.2.7 I added something far better, and it doesn't involve any new params. Instead the Pulldown has been intelligent enough to know that when a new push has given it the same sid it had before, and the same postProcess search string, that it should not refresh. Thus you can head towards best practices, reusing jobs with postprocess and rearranging where searches are getting dispatched in the view and as a side effect of that, your Pulldowns will only do their jittery reload only when they need to. See Sideview Utils Docs "Key Techniques > Advanced XML Overview" for more details on "where searches are getting dispatched in the view" cause before you read that page you won't know what I'm talking about.

sideview
SplunkTrust
SplunkTrust

I'm not familiar with the AutoRefresh module, but I suspect you got it from another answer on this site. If it works by doing a "push" and not by reloading the page, then I would then just have the AutoRefresh module downstream from the Button. And if on the other hand it works by reloading the entire page, then it's "allowAutoSubmit" that has the potential to block it, not "allowSoftSubmit"

ma_anand1984
Contributor

Is it possible to have allow auto refresh as well as run the search upon pressing submit button together ?

< module name="AutoRefresh" >
< param name="invervalInSeconds" >300< /param >

0 Karma

ma_anand1984
Contributor

Nick,
We wanted to have allowSoftSubmit because we have autorefresh in place. We want the page to reload every interval of time. its one of the main dash board for monitering

0 Karma

SarahBOA
Path Finder

It appears that my assumption in #2 is incorrect. The JobStatus module is running when the main search is running. The issue is that the main search is kicked off every time a Pulldown changes. Since each Pulldown that has a search behind it is reloaded, the main search is actually being run several times. So it is really another effect of issues #1.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...