All Apps and Add-ons

Web Framework Require Local File

alacercogitatus
SplunkTrust
SplunkTrust

Hello, in developing a new app, I want to referance a local file, not a website.

I have this: require(["https://code.jquery.com/ui/1.10.0/jquery-ui.js"], but want it to be local to the /appserver/static folder.

How to achieve?

In case of any clarifications please revert.

0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

Found it. I did this:

require(["{{SPLUNKWEB_URL_PREFIX}}/static/app/APPNAME/jquery-ui.js"]

View solution in original post

alacercogitatus
SplunkTrust
SplunkTrust

Found it. I did this:

require(["{{SPLUNKWEB_URL_PREFIX}}/static/app/APPNAME/jquery-ui.js"]

alacercogitatus
SplunkTrust
SplunkTrust

It's built in to Splunk 6, no additional django items needed. A little more seamless, IMHO. Splunk 5 - Definitely requires Django framework.

0 Karma

aelliott
Motivator

Gotcha, thanks.. I've only used the django framework, Is there a reason you choose the html dashboards over django?

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Right in the HTML Dashboard. I'm using Splunk 6.

0 Karma

aelliott
Motivator

What file do you place that in?

0 Karma

aelliott
Motivator

Put the javascript file in Splunk/etc/apps/MyAppName/django/MyAppName/static/MyAppName

Add this to html file in Splunk/etc/apps/MyAppName/django/MyAppName/templates

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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