All Apps and Add-ons

Sideview Utils: How to change which view the redirector sends a drilldown to based on host name clicked on a table?

tmarlette
Motivator

I was wondering if there was a way to change which view the redirector sent
the 'drilldown' to based on the host name, when someone clicks on a table?
The table would contain three different naming conventions, which equal
three different views.

for example:
For anything named host="qa" there is a qa view.
For anything named host="prod" there is an rmq view.

Thank you!

0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

Absolutely. You would have a ValueSetter module with say a name of "conditional_url"
and three different conditional params. The ValueSetter module's docs go into this briefly (and should have more detail than they do), but you can crib working examples from the hidden testcase view called "testcases_for_value_setter_conditionals".

Anyway, you set the $conditional_url$ key to one of three different values

and then Redirector just has <param name="url">$conditional_url$</param>

Let me give a specific example to show it all. Let's say that upstream we have a Table module with a drilldown, and that's the interaction that sends the user to the right page. Let's say that "host" is one of the fields in that Table.

<module name="ValueSetter">
  <param name="name">conditional_url</param>
  <param name="if.$row.fields.host$=qa">qa</param>
  <param name="default">rmq</param>
  <module name="Redirector">
    <param name="url">$conditional_url$</param>
    <param name="someField">$row.fields.someField.rawValue$</param>
    etc...
  </module>
</module>

View solution in original post

sideview
SplunkTrust
SplunkTrust

Absolutely. You would have a ValueSetter module with say a name of "conditional_url"
and three different conditional params. The ValueSetter module's docs go into this briefly (and should have more detail than they do), but you can crib working examples from the hidden testcase view called "testcases_for_value_setter_conditionals".

Anyway, you set the $conditional_url$ key to one of three different values

and then Redirector just has <param name="url">$conditional_url$</param>

Let me give a specific example to show it all. Let's say that upstream we have a Table module with a drilldown, and that's the interaction that sends the user to the right page. Let's say that "host" is one of the fields in that Table.

<module name="ValueSetter">
  <param name="name">conditional_url</param>
  <param name="if.$row.fields.host$=qa">qa</param>
  <param name="default">rmq</param>
  <module name="Redirector">
    <param name="url">$conditional_url$</param>
    <param name="someField">$row.fields.someField.rawValue$</param>
    etc...
  </module>
</module>
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...