All Apps and Add-ons

Referring value chosen in pulldown in search bar in sideview

strive
Influencer

Hi,

We are evaluating sideview for our application. I have a need where in i should pass upwards the param from pulldown. Is this possible?

Say, the analyze pulldown has Max, Min and Avg as values. If i choose Max, i should be able to pass a param to search bar.

Thanks

Strive

1 Solution

sideview
SplunkTrust
SplunkTrust

You don't have to (or want to) post the value upstream to the SearchBar. The Splunk UI framework really doesn't like to send things upstream and things get weird fast if you evr figure out how to do it. Instead you just let the SearchBar's value come down to you.

Sideview Utils patches SearchBar such that it creates a simple token that you can refer to downstream as $searchBar$ (or $searchBar.value$). So all you have to do is use an extra Search module downstream, and use $searchBar$ as well as the Pulldown's $foo$ token and other $foo$ tokens, to pull it all together and determine the final search. I actually always use SearchBar this way and I recommend it. You'll quickly come to see SearchBar's "normal" way as pretty strange.

That said, part of me thinks there's a way to keep it pretty simple. If the summary index fields were called avgBandwidth, maxBandwidth, and minBandwidth, then you could simply have the Pulldown submit values like "max(max" "min(min", and "last(avg", plug them in as timechart $stat$$fieldName$). And maybe this will give you an idea for a similar trick.

View solution in original post

sideview
SplunkTrust
SplunkTrust

You don't have to (or want to) post the value upstream to the SearchBar. The Splunk UI framework really doesn't like to send things upstream and things get weird fast if you evr figure out how to do it. Instead you just let the SearchBar's value come down to you.

Sideview Utils patches SearchBar such that it creates a simple token that you can refer to downstream as $searchBar$ (or $searchBar.value$). So all you have to do is use an extra Search module downstream, and use $searchBar$ as well as the Pulldown's $foo$ token and other $foo$ tokens, to pull it all together and determine the final search. I actually always use SearchBar this way and I recommend it. You'll quickly come to see SearchBar's "normal" way as pretty strange.

That said, part of me thinks there's a way to keep it pretty simple. If the summary index fields were called avgBandwidth, maxBandwidth, and minBandwidth, then you could simply have the Pulldown submit values like "max(max" "min(min", and "last(avg", plug them in as timechart $stat$$fieldName$). And maybe this will give you an idea for a similar trick.

strive
Influencer

Hi,
Thanks for your comment. We use a summarized index in sideview for one of our screens. In our summarized index we already have Max, Min and average calculated. Performing Max, Min and Avg on already summarized data is not correct. logically Max and Min will be fine. But Avg(Avg) is not the right data to show.
Our idea is to pass the stat chosen upstream and choose a field dynamically in macro using conditional statements.

Analyze dropdown will have three options (Max, Min and Avg). Of dropdown will have just one value (Bandwidth).

0 Karma

sideview
SplunkTrust
SplunkTrust

Can you update your question to have more detail?

In most cases where there's an urge to "send data upstream", the answer is to rethink the solution in a way that the end result is achieved without anything going upstream.

It would be great if you could spell out the reasoning why you want the selected Pulldown value to affect the value of the SearchBar upstream. I'll answer once I have a better idea of the situation.

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