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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...