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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...