All Apps and Add-ons

Sideview Utils: How to use redirector module to send a user to a different view that has a prepopulated pulldown?

Splunkster45
Communicator

Currently,I have a search query that gives me a table with 4 columns, A, B, C, D. The user clicks on a row and and is taken to another search that is populated with the search term for column A in the row they clicked on.

For example

A.....B.....C.....D
1.....7......7.....7
2.....7......7.....7
3.....7......7.....7
4.....7......7.....7

And the user selected the second row, they would be taken to the query "A=2 index=..."

Instead of having the user be taken to another query, I want to send the user to another sideview-utils view. What makes this tricky is that this view has a drop down menu corresponding to each of the items in column A (e.g. 1, 2, 3, 4) and so if the click on 2 in the first dashboard they woud be sent to the new view with the pulldown prepopulated with 2.

Is this even possible? Below is my code for the redirector in the first view. I don't use a time frame and so I thnk I can ditch arg.latest and arg.earlies. I also don't know what flashtimeline does. I'm just using it because I've seen it used on a different dashboard. I think I will need to change arg.q to reference the view.

 <module name="Search" layoutPanel="panel_row2_col1" autoRun="True">
<param name="search"><![CDATA[ index=spss ...</param>
<module name="SimpleResultsTable">
  <param name="drilldown">row</param>
  <module name="Redirector">
    <param name="arg.q">search $click.searchTerms$ index=spss sourcetype=datastage host=prodencetlds21l</param>
    <param name="arg.latest">$search.timeRange.latest$</param>
    <param name="arg.latest">$search.timeRange.latest$</param>
    <param name="url">flashtimeline</param>
    <param name="arg.earliest">$search.timeRange.earliest$</param>
  </module>
</module>

Thanks!
Let me know if you have any questions.

0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

Certainly. The other half of the equation is a URLLoader module on the target view.

And there's a docs page in Sideview Utils under Key techniques > Linking from view to view> Linking to other views from tables. If you don't see this page, you may be using the extremely old and out of date 1.3.5 version. (Current version is 3.3.2 and available from the sideview site)

That page goes over how to do this and gives a working example that uses the index=_internal data.

Here's a dead simple example though, to give you the flavor.

In view 1:

<module name="Table">
  <module name="Redirector">
    <param name="url">mySecondView</param>
    <param name="arg.foo">$foo$</param>
  </module>
</module>

View 2:

<module name="URLLoader" layoutPanel="panel_row1_col1" autoRun="True">

  .. possible other modules downstream from URLLoader but upstream from Pulldown

  <module name="Pulldown">
    <param name="name">foo</param>
    ... other params
      ... other modules.

View solution in original post

sideview
SplunkTrust
SplunkTrust

Certainly. The other half of the equation is a URLLoader module on the target view.

And there's a docs page in Sideview Utils under Key techniques > Linking from view to view> Linking to other views from tables. If you don't see this page, you may be using the extremely old and out of date 1.3.5 version. (Current version is 3.3.2 and available from the sideview site)

That page goes over how to do this and gives a working example that uses the index=_internal data.

Here's a dead simple example though, to give you the flavor.

In view 1:

<module name="Table">
  <module name="Redirector">
    <param name="url">mySecondView</param>
    <param name="arg.foo">$foo$</param>
  </module>
</module>

View 2:

<module name="URLLoader" layoutPanel="panel_row1_col1" autoRun="True">

  .. possible other modules downstream from URLLoader but upstream from Pulldown

  <module name="Pulldown">
    <param name="name">foo</param>
    ... other params
      ... other modules.

Splunkster45
Communicator

I finally downloaded splunk/sideview utils on my laptop so I can go along with the examples. From what I'm readying, I'm pretty much convinced that this should work, however, I'm not having much luck with it. I can get the redirect to work, but the static pulldown menu always defaults to the first item in the list (e.g. a)

I wasn't able to find the xml of the second view, but I did pull it up in the sideview editor 🙂 Having both views is very helpful.

View 1

   <module name="Search" layoutPanel="panel_row2_col1" autoRun="True">
        <param name="search">index=spss...</param>
        <module name="SimpleResultsTable">
          <param name="drilldown">row</param>
          <module name="Redirector">
            <param name="url">ETL_Dashboard_clone</param>
            <param name="arg.selectedModel">$selectedModel.rawValue$</param>
          </module>
        </module>
      </module>

View 2

 <module name="URLLoader" layoutPanel="panel_row1_col1" autoRun="True">
    <module name="Pulldown">
      <param name="staticOptions">
        <list>
          <param name="value">a</param>
          <param name="label">a</param>
        </list>
        <list>
          <param name="value">b</param>
          <param name="label">b</param>
        </list>
      </param>
      <param name="label">select</param>
      <param name="name">selectedModel</param>
      <module name="Search" layoutPanel="panel_row2_col1">
        <param name="search">index=spss  type="*$selectedModel$*" </param>
        <module name="HiddenChartFormatter">

...

In view 1
I've tried replacing
<param>$selectedModel.rawValue$
with
<param>$row.fields.selectedModel$

but to no avail.

Any thoughts?

0 Karma

sideview
SplunkTrust
SplunkTrust

In the Redirector, <param>$row.fields.selectedModel$ and just make sure that you do have a field called that, remembering that field names are case-sensitive. Also there has to be an option in the Pulldown matching the given value of course.

Sorry for not putting that in my answer - I didn't know whether you were passing a simple token from upstream, or a field value from the Table so I left a generic $foo$ there.

0 Karma

Splunkster45
Communicator

I'm getting a little confused between the variable that is passed from one view to the other.

Does row.fields mean anything or can I used $selectedModel$ throughout both views.

So to see if I understand you I here's what I think needs to happen:

View 1
1) The Redirector needs to be in the following format:
arg.selectedModel =$row.fields.selectedModel $

View 2
2) The pull down needs to be in the following format:
name=$row.fields.selectedModel$
3) Whatever the user clicked on needs to be a label option in the staticOptions

Any option downstream of the pulldown module referring to the selected pulldown option needs to be $row.fields.selectedModel$ (currently mine are all selectedModel)

In short, I'm not sure when to use row.fields.selectedModel and when to use selectedModel

0 Karma

sideview
SplunkTrust
SplunkTrust

$row.fields.selectedModel$ is purely for the Table module. You only use it in the Redirector. The name of the Pulldown should be "selectedModel". Thirdly, the Pulldown has to have an actual value that matches the value that you're trying to preselect. This is all described and illustrated with working examples in the documentation under "Module Documentation > Table", as well as "Module Documentation > Pulldown", and "Key Techniques > Linking from view to view". I've just been summarizing it here, assuming you've already skimmed the docs.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...