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!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...