Dashboards & Visualizations

Custom HTML App URL Parameter

mfritsch
New Member

Hello,

I like to build a custom app in splunk. This app is using an HTML view. From my HTML view I like to navigate to a dynamic sub view.
How can I access an URL parameter in my sub html view.

URL Example: app//mydynamic_sub_view?param1=helloWorld

Is it possible to get the param1 by using jQuery?

thanks for your help.

Tags (3)
0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Oh, so in this case, you don't want to load the subview INSIDE the main view, you want to drill down to another view.

In your app/myapp/details, use the form features of SimpleXML.

<form>
   <fieldset>
   <input type="text" token="id">
  </fieldset>
 ....
 </form>

See the complete reference here: http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#form

Then, you can pass items through the URL, just like you would like: app/myapp/details?form.id=49.

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

You need to explain "Dynamic Sub View". If I am understanding correctly, you will have 2 views defined. You want to load (via iframe perhaps) the sub view with a query passed in from the main view.

Short answer: Yes and No. It all depends on the definition of your sub view.

IMHO, you are already using an HTML view. Leverage the JS on a single view, and dynamically build panels and views withing the master view. Don't try to load a second view, instead build it dynamically within the master view.

0 Karma

mfritsch
New Member

I like to have two views.

1. Overview - URL: app/myapp/overview
...

<ul>
<li><a href="app/myapp/details?id=1">Item1</a></li>
<li><a href="app/myapp/details?id=2">Item2</a></li>
<li><a href="app/myapp/details?id=3">Item3</a></li>
</ul>

</body>
...

2. Details View - URL app/myapp/details?id=2

When I click on a link I like to navigate to the details view. Inside of the details view I like to evaluate the url paramter (id) to load additional data from a REST Service from outside of Splunk.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...