All Apps and Add-ons

Splunk Dashboard 6.x Examples Source Code: Where do I place or write .js scripts?

sushmitha_mj
Communicator

I downloaded this app and am using this... It is simply awesome !!
I was trying the "Link switcher" in this app, and it has one xml and three .js scripts in source code section.
I do not know where to place, or write the .js scripts. I can only see an option for xml code while writing dashboard scripts.

Could you please help?

0 Karma
1 Solution

stephanefotso
Motivator

Put it on $SPLUNK_HOME/etc/apps/yourappname/appserver/static. Do not forget to restart splunk.
Thanks
Notice: if the static or the appserver folder is not there, create it.

SGF

View solution in original post

tom_frotscher
Builder

Hi,

you go to the splunk app, where your dashboard belongs to. And there you can find, or you have to create the follwing folder:

/appserver/static

So over all it looks like:

$SPLUNK_HOME/etc/apps/<app_name>/appserver/static/

There you put in your js Files (you can also put css files and other stuff there). Read more about this here: link

Greetings

Tom

gsfiorese_au
Engager

My apologies for reopening the topic ...

But I have the same problem and even after restarting the splunk nothing happens. It is possible within the splunk open a window for editing the codes in javascript? Likewise which it appears on app Splunk Dashboard 6.x Examples??

alt text

I have done javascript and already put him on the right path: c:/program files/Splunk/etc/apps/app_gabriel/appserver/static

and I have done the restart of the system but still can not view the source code within the Splunk.

Anyway was wondering if this is possible, and if so what I have to do to be able to display correctly.

Thank you all.

0 Karma

tom_frotscher
Builder

Hi,

have you edited your simple xml and added the script attribute to your dashboard or form tag?

<dashboard script="nameOfYourJs.js">

or

<form script="nameOfYourJs.js">

at the start of your simple xml. Also check if the appserver, static folder and the js file have the corresponding rights. Likewise, the system user needs read and write rights on this files.

Greetings

Tom

0 Karma

stephanefotso
Motivator

Put it on $SPLUNK_HOME/etc/apps/yourappname/appserver/static. Do not forget to restart splunk.
Thanks
Notice: if the static or the appserver folder is not there, create it.

SGF
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...