Dashboards & Visualizations

How to include an external script in HTML dashboards in an App?

kartik13
Communicator

I am having an external Script stored in the static folder in the at the following path:

/Splunk_Home/etc/apps/app_name/appserver/static/myscript.js

I want to include that script in HTML dashboards. How do I do this? I mean, what will be the relative path to include it in the script src

<script type="text/javascript" src="/path/to/myscript.js"></script>

What is the path? I tried giving the actual path, but it didn't work out for me.
Any help !!!

0 Karma
1 Solution

kartik13
Communicator

Found the way

<script type="text/javascript" src="{{SPLUNKWEB_URL_PREFIX}}/static/app/app_name/myscript.js"></script>

View solution in original post

0 Karma

kartik13
Communicator

Found the way

<script type="text/javascript" src="{{SPLUNKWEB_URL_PREFIX}}/static/app/app_name/myscript.js"></script>
0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...