Dashboards & Visualizations

Can you use token values in HTML module for dashboards?

feickertmd
Communicator

I have heard that the HTML module would render token values. I can find nothing on how to do it. I tried this:

<h1>I KNOW WHO YOU ARE $Area$</h1>
</html>

What I get is this:

I KNOW WHO YOU ARE $Area$

Tags (2)
1 Solution

guilmxm
Influencer

Hi, yes you can use tokens in HTML views, quite easily.

For example, a view that would contain

<h1>My custom token is $foo$</h2>

Called with an uri like:

my_simple_xml_view?foo=bar

Will replace the token by the substitute value.

NB: In 6.1.x version, a bug has affected token substitution in href html, token were not substituted by expected values
This has been corrected in 6.2 (a workaround was to convert the view in html)

View solution in original post

0 Karma

feickertmd
Communicator

Okay, that explains it. We have 6.12

0 Karma

guilmxm
Influencer

Hi, yes you can use tokens in HTML views, quite easily.

For example, a view that would contain

<h1>My custom token is $foo$</h2>

Called with an uri like:

my_simple_xml_view?foo=bar

Will replace the token by the substitute value.

NB: In 6.1.x version, a bug has affected token substitution in href html, token were not substituted by expected values
This has been corrected in 6.2 (a workaround was to convert the view in html)

0 Karma

guilmxm
Influencer

Raghav2384
Motivator

Sideview Utils! Has ton of examples to achieve what you're looking for

0 Karma

feickertmd
Communicator

Is it 6.x compatible? The app page says 5.0

0 Karma

Raghav2384
Motivator

App might not, but the examples will give you an idea on how to reference.

0 Karma

somesoni2
Revered Legend

Do you have the token defined?

0 Karma

feickertmd
Communicator

Yes, its is defined in the code I posted

0 Karma

tom_frotscher
Builder

In the code you posted is no definition of the token.

<h1>I KNOW WHO YOU ARE $Area$</h1> </html>

It just asks for the token $Area$ and substitude by whatever is in this token. But you must have defined it before. For example by a text input, a dropdown list or a drilldown.
Can you use the token in an other situation? For example in the title of a panel or in a drilldown search.

0 Karma

feickertmd
Communicator

How weird, my glob of code has disappeared! Yes, I have it defined in a previous piece of code.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...