Dashboards & Visualizations

pass a parameter to xml view from iframe

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

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.

Path Finder

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

0 Karma

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
Don’t Miss Global Splunk
User Groups Week!

Free LIVE events worldwide 2/8-2/12
Connect, learn, and collect rad prizes
and swag!