Dashboards & Visualizations

pass a parameter to xml view from iframe

firasarabo
Path Finder

Hi,

I followed the example shown at http://docs.splunk.com/Documentation/Splunk/latest/Developer/3rdParty
and created a view that does some search as:



A="REQFS" F=SomeService | timechart span=5m count
-1h
....
....

and I am calling this view from iframe like:
http://mysplunkserver/en-US/account/insecurelogin?username=admin&password=changeme&return_to=/app/my...

and results show up fine, what I need to do is to pass parameters to change the time and F= values on the fly, how to do that?

Thanks,

Tags (2)
0 Karma

sideview
SplunkTrust
SplunkTrust

Kind of a pain with just the core Splunk modules but what you'd do is create a fully formed search string incorporating your dynamic value of "F", from wherever you're putting the iframe. (I'm assuming that your iframe is being created in some third party system by the way, not in a Splunk view). Then you want to form time arguments either as epochTime numbers or splunk's relative time expressions (-24h, rt-30m@m) etc.. ,

Then instead of

return_to=/app/myapp/some,

you'd have this, which would send the user to the default search UI where the full search will run.

return_to=/app/myapp/flashtimeline?q=search <your search expression here>&earliest=<your earliest time>&latest=<your latest time>

If you use the Sideview Utils modules and familiarize yourself with the techniques those modules provide for linking between views, then you'll have a lot more flexibility. For one thing you can link to a view that doesnt just have a giant search bar - it could itself have an editable Textfield or Pulldown for that "F" value.

Then your return_to would look more like `return_to=/app/myapp/someView?F=&earliest=&latest=, and you could refer to that F value anywhere in the target view's searches or in it's headers just as $F$.

Hope that helps. If you do decide to use Sideview Utils, within the app itself there's a lot more documentation about these techniques and many more.

firasarabo
Path Finder

by the way, I am reading on sideview, it looks it has what I need to do.

0 Karma

firasarabo
Path Finder

Hi Nick,
thanks for you answer, I do not want to redirect the users to the default search UI, instead I need only to show them the result right on the page. having the view the way indicated in http://docs.splunk.com/Documentation/Splunk/latest/Developer/3rdParty is giving exactly what I need however I would like to extend that to supply F on the fly. I am trying to create forms however what I am getting back is a full search form which I don't want, I probably want to have a drop down menu where users can select F as example and I then can pass that somehow to my view which returns a chart.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Turn Cisco Telemetry Into Action with Cisco Data Fabric, powered by the Splunk ...

The surge in machine data is already hitting enterprise budgets, and the agentic era will only intensify it. ...

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...