All Apps and Add-ons

how to prepopulate the value in second view coming from first view's clicked on event using sideviewUtils.

disha
Contributor

I have pie chart in my first view and when user clickon any part of pie chart, the eventid is passing to next view using redirector.

Vsideview
$click.value$

In second view I have dropdown list of eventid and I need to perform search with the value passed by first view and need to prepopulate it also.



<![CDATA[
sourcetype="jsonrevtwo"
| spath path="EventID" output=EventID

| spath path="Location" output=City
| spath path="Critical" output=Critical
| stats count by EventID City Critical
]]>
EventID
$name$
| search $name$="$value$"
$name$
left
dedup $name$ | sort $name$

and after submit the search is like

<![CDATA[ * $sourcetype$| spath path="EventID" output=EventID
| spath path="Location" output=City
| spath path="Critical" output=Critical
$EventID$
$City$
$Critical$
| chart count(eval(Critical="FALSE")) AS "Normal Temp." , count(eval(Critical="TRUE")) AS "Critical Temp." by City
]]>

I have gone thru the documentation and tried StaticOptions module but I am confused between StaticOptions,ValueSetter and ResultsValueSetter for how to prepopulate the value in second form coming from redirector module and how to pass it to search. Please help.

0 Karma
1 Solution

disha
Contributor

Thanks to Nick.
I got the solution. I was doing silly mistake as in first view I was passing eventID and collecting EventID thats why it was not prepopulating. I just make both variable identical and it worked automatically.
Tip to remember:
All you have to do to get the value to prepopulate is to make sure

-- the target view's URL has a City="foo" in it.
-- The target view has a URLLoader module in it.
-- you're using Pulldown and not SearchSelectLister or StaticSelect.
-- the Pulldown module is nested downstream from the URLLoader
-- the Pulldown has a "name" param that matches the argument exactly (ie City)
-- the Pulldown does end up with a value matching the "foo" value exactly.

View solution in original post

0 Karma

disha
Contributor

Thanks to Nick.
I got the solution. I was doing silly mistake as in first view I was passing eventID and collecting EventID thats why it was not prepopulating. I just make both variable identical and it worked automatically.
Tip to remember:
All you have to do to get the value to prepopulate is to make sure

-- the target view's URL has a City="foo" in it.
-- The target view has a URLLoader module in it.
-- you're using Pulldown and not SearchSelectLister or StaticSelect.
-- the Pulldown module is nested downstream from the URLLoader
-- the Pulldown has a "name" param that matches the argument exactly (ie City)
-- the Pulldown does end up with a value matching the "foo" value exactly.

0 Karma
Get Updates on the Splunk Community!

AppDynamics Summer Webinars

This summer, our mighty AppDynamics team is cooking up some delicious content on YouTube Live to satiate your ...

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...