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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...