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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...