All Apps and Add-ons

How to pass values from Pulldown to a Tab

lemikg
Communicator

Hi,

currently I am having problems passing a value in sideviews from a pulldown and switcher to a tab in order to execute a search. I created a html module to check if it will be displayed there and so far that worked out.

But I want to get that value depending on the selection within the pulldown and switcher module get passed to the tab.

Is that possible? Please find below a screenshot.

Thanks in advance for your help.

regards
Mike
alt text
alt text

1 Solution

sideview
SplunkTrust
SplunkTrust

The idea is that you're using two modules - Pulldown and Tabs, to create $foo$ tokens, in this case $selectedHost$ and $selectedTab$, and then you will plug both of those values into a Search param that is downstream from both.

What you're doing here is trying to plug the $selectedHost$ value into the value of the Tabs module, but that's making things too complicated. Just let the Tabs value be one thing, and the Pulldown value be another, and then combine them in the Search module.

ie

<module name="Search">
  <param name="search">$selectedHost$ $selectedTab$ | timechart max(foo) by bar</param>

View solution in original post

sideview
SplunkTrust
SplunkTrust

The idea is that you're using two modules - Pulldown and Tabs, to create $foo$ tokens, in this case $selectedHost$ and $selectedTab$, and then you will plug both of those values into a Search param that is downstream from both.

What you're doing here is trying to plug the $selectedHost$ value into the value of the Tabs module, but that's making things too complicated. Just let the Tabs value be one thing, and the Pulldown value be another, and then combine them in the Search module.

ie

<module name="Search">
  <param name="search">$selectedHost$ $selectedTab$ | timechart max(foo) by bar</param>

lemikg
Communicator

It is weird, but it helped me figuring out wether The value was being passed down or not.

0 Karma

sideview
SplunkTrust
SplunkTrust

Cool. One other comment - it's a little weird to have anything downstream from an HTML module like you have in your screenshot from the Sideview Editor. It wont hurt anything but it wont really do anything either. Sometimes I nest things just cause I want the layoutPanel att's to all be specified in a single place, but for the most part unnecessary nesting just causes confusion in the long run.

0 Karma

lemikg
Communicator

Wow, thanks. That worked.

0 Karma

sideview
SplunkTrust
SplunkTrust

Oh. Well just don't put that in there, but instead pull it out into the Search module downstream. I'll write up a proper answer below.

0 Karma

lemikg
Communicator

It Loks exactly like that. host="$selectedHost$"

0 Karma

sideview
SplunkTrust
SplunkTrust

And you're using it in a different way? Can I assume it does not look like host="$selectedHost$" ?

0 Karma

lemikg
Communicator

Hi,
Thanks for having a look at my question.

Yes i am using the $selectedHost$ in the Performance-Tab, (right After sourcetype) unfortunately it. Doesn't show.

Cheers
Mike

0 Karma

sideview
SplunkTrust
SplunkTrust

So the user picks a host, and then picks either Hardware, Commands or Performance from the Tabs module. I see you're trying to use $selectedHost$ in Hardware and Command (that wont work but more on this when I answer), my first question is -- are you not using the $selectedHost$ key at all in Performance, or are you using the key but using it in a different way? If you can answer that question I can er, better answer your Question. 😃

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