All Apps and Add-ons

Creating a dynamic view with sideview utils

brettcave
Builder

hi sideview experts,

Is it possible to create a dynamic sub-report with sideview? I am looking to create a search that returns a list of results. For each row of the results, I want to populate a PullDown element, and then push the results to all sub-searches.

1. Date IDx Summary1 Summary2
2. Date IDy Summary1 Summary2

Pulldown
  - IDx 
  - IDy

ID Details: x / y / z

So in the example above, I want to get a list of all events in the top section, and populate the PullDown with a list of ids from the search. As each ID is selected, then other sub-searches / PostProcessors are run using the ID as a filter.

Is this possible? What sort of approach would be needed?

0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

This is just the standard way in which you use the Pulldown module. Have you checked out the documentation? There are many pages of docs guiding you through Pulldown. The first page goes over just the "static" configurations, where you hardcode the option list into the view. The second page though is dedicated to dynamic configurations. Other pages thereafter add on to that base knowledge by showing you more examples of optional params and how to do multiselect and how to prepopulate and redirect etc...

And you can use Pulldown to fill tokens into PostProcess searches as well as downstream Searches with no problem. It's exactly as you might expect.

I went ahead and cribbed from all the working examples in the Sideview Utils docs, to make an example that matches your exact use case.

<module name="TextField" autoRun="True">
  <param name="name">Filter sourcetypes</param>
  <param name="label">seriesFilter</param>
  <param name="template">series="*$value$*"</param>

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

    <module name="Search">
      <param name="search">index=_internal source="*metrics.log" group="per_sourcetype_thruput" $seriesFilter$ | stats sum(kb) as KB max(eps) as maxEps count by series, date_hour</param>
      <param name="earliest">-4h</param>
      <param name="latest">now</param>

      <module name="PostProcess">
        <param name="search">stats sum(KB) as KB by series</param>
        <module name="Pager">
          <module name="Table"/>
        </module>

        <module name="Pulldown">
          <param name="name">selectedSourcetype</param>
          <param name="label">Sourcetype</param>
          <param name="valueField">series</param>

          <module name="PostProcess">
            <param name="search">search series="$selectedSourcetype$" | chart max(maxEps) as maxEps over series by date_hour</param>

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

In your diagram, you're showing the Pulldown downstream from the Table, which would technically be an inline drilldown config. Although this is certainly possible and very easy to do, since you make no other mention of inline drilldown, I'm making the assumption that you do not want that. If you nest the Pulldown inside the Table, then it will remain invisible until a row in the Table is clicked.... And you can reference any selected field value from that Table row as $row.fields.fieldName$. If that's what you actually wanted, let me know and I can modify this answer, but again there are tons of docs in Sideview Utils and there's a whole page talking about inline drilldown, how it works and the $foo$ tokens available etc..

View solution in original post

sideview
SplunkTrust
SplunkTrust

This is just the standard way in which you use the Pulldown module. Have you checked out the documentation? There are many pages of docs guiding you through Pulldown. The first page goes over just the "static" configurations, where you hardcode the option list into the view. The second page though is dedicated to dynamic configurations. Other pages thereafter add on to that base knowledge by showing you more examples of optional params and how to do multiselect and how to prepopulate and redirect etc...

And you can use Pulldown to fill tokens into PostProcess searches as well as downstream Searches with no problem. It's exactly as you might expect.

I went ahead and cribbed from all the working examples in the Sideview Utils docs, to make an example that matches your exact use case.

<module name="TextField" autoRun="True">
  <param name="name">Filter sourcetypes</param>
  <param name="label">seriesFilter</param>
  <param name="template">series="*$value$*"</param>

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

    <module name="Search">
      <param name="search">index=_internal source="*metrics.log" group="per_sourcetype_thruput" $seriesFilter$ | stats sum(kb) as KB max(eps) as maxEps count by series, date_hour</param>
      <param name="earliest">-4h</param>
      <param name="latest">now</param>

      <module name="PostProcess">
        <param name="search">stats sum(KB) as KB by series</param>
        <module name="Pager">
          <module name="Table"/>
        </module>

        <module name="Pulldown">
          <param name="name">selectedSourcetype</param>
          <param name="label">Sourcetype</param>
          <param name="valueField">series</param>

          <module name="PostProcess">
            <param name="search">search series="$selectedSourcetype$" | chart max(maxEps) as maxEps over series by date_hour</param>

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

In your diagram, you're showing the Pulldown downstream from the Table, which would technically be an inline drilldown config. Although this is certainly possible and very easy to do, since you make no other mention of inline drilldown, I'm making the assumption that you do not want that. If you nest the Pulldown inside the Table, then it will remain invisible until a row in the Table is clicked.... And you can reference any selected field value from that Table row as $row.fields.fieldName$. If that's what you actually wanted, let me know and I can modify this answer, but again there are tons of docs in Sideview Utils and there's a whole page talking about inline drilldown, how it works and the $foo$ tokens available etc..

brettcave
Builder

awesome, works great. didn't read the manual, oops 😮

0 Karma

brettcave
Builder

Oh - one other thing - the initial search is built with a TextField

TextField
  -Button
    -Search - uses $textValue$
      -PostProcess
        -Table
          -TODO:PopulatePullDownFromPostProcess
            -OnPullDownChangePostProcess

The last 2 components is what I am looking to achieve.

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