All Apps and Add-ons

Hide search results but pass parameters from results

kmattern
Builder

I have a view that passes arguments to a second view. Among the arguments is a link for drilldown to a third view. But not all results on the first view will result in an argument to pass. To determine this a search must be run on the selected parameter before the redirector is activated.

Running a search should be no problem but I do not want to display the results. Instead, if there is a result I want that to become an argument in the redirector. Otherwise I want to pass an empty argument.

I'm using Sideview Utils to pass the arguments.

Is there a way to do this?

0 Karma

nick
Explorer

Sure. Just above your current Redirector, insert a Search and a ResultsValueSetter to make it look like this:

Search
  ResultsValueSetter
    Redirector

That Search will just quickly (well hopefully your search is quick) dispatch the search logic you need, and the ResultsValueSetter will pull down the one or more fields you tell it, so that they become $fieldName$ tokens in the UI. Then you can simply use those $fieldName$ tokens in your Redirector. As far as having a little logic around null values and defaults and what-have you, if you're already in search I find it easier to just use eval's up there. However ValueSetter has a lot of tricks and the ability to do simple conditional logic.

As always the docs pages and embedded examples in Sideview Utils itself can illustrate each of these modules in better detail.

http://sideviewapps.com/apps/sideview-utils

By the way, if that little search takes more than a second or so you probably want to look into using a JobProgressIndicator module. Or this might be one of those few cases where the JobSpinner is a slightly better fit than JobProgressIndicator... .

0 Karma

nick
Explorer

I forgot to say - remember that ResultsValueSetter only ever gets fields from the first row, so therefore make sure your search is such that it will only ever have one row. That is a common pitfall when people are first using ResultsValueSetter.

0 Karma

kmattern
Builder

Thanks Nick. That looks exactly what I am looking for. I'll give it a try.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

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