All Apps and Add-ons

How to use parameter q from the URL in the View XML

tkadale
Path Finder

Hi

I am passing a search query through url to a view. I want to use the passed query as a filter to the graphs I am showing in the view.

How can I use the q URL param in view xml?

Tags (1)

sideview
SplunkTrust
SplunkTrust

This should be asked as a separate question.
However what are you trying to do? It looks very strange. metadata type="sources" will contain only sources - there will be no host fields and if "summer2" is a hostname, and if $host$ comes from some other pulldown you haven't included, that contributes a hostname, then I'd expect the search to always return 0 results. Also you're using HiddenSearch instead of Search so, if you're using Sideview's modules that wont work at all... etc...
But lets start with the full XML, what you're trying to do, and lets move it to a different question.

David
Splunk Employee
Splunk Employee

Unfortunately, you can't do this in Splunk out of the box. Fortunately, it is possible with an app called sideview utils, available on Splunkbase. You'll need convert your views to advanced XML if they aren't already, so there is definitely more complexity, but then you'll be able to pass parameters with ease.

Sideview Utils on Splunkbase

hexx
Splunk Employee
Splunk Employee

Please provide the XML snippet showing the module definition where this feature is used.

0 Karma

ReanaKhan
Explorer

Does thi need sive ViewUtils app.

I tried to do this and i got this error

TypeError: () got an unexpected keyword argument 'q'

0 Karma

sideview
SplunkTrust
SplunkTrust

Redirector and URLLoader are the two main players, and then the Pulldown, TextField and Checkbox modules themselves prepopulate so they play a role too. Download Sideview Utils and read through the several pages of documentation in the 'general techniques > linking' section.

tkadale
Path Finder

Which modules from SideViewUtils should I use to achieve this??

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...