Dashboards & Visualizations

how can i add jquery.min.js to use on dashboard ?

sfatnass
Contributor

hi,

i have some source code jquery using jquery.min.js
but when i try to add this, splunk reject it and get an error.

so how can i use it for splunk dashboard thx

0 Karma

jpolcari
Communicator

Files such as javascript and css can be added to the statis folder for the app:

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

Once the file is added there, you can link it within your dashboard XML config:

<dashboard stylesheet="myStyleSheet.css" script="myJavaScript.js">
   . . .

You will also have to restart Splunk once those files are added.
Check this link for some more information:

http://docs.splunk.com/Documentation/Splunk/6.4.3/Viz/CustomizeSimpleXML

0 Karma

sfatnass
Contributor

i know that but when i try it i get an error.

this an example of jquery content : link here

i ask the question because i try to add a "owl carousel" for a home page in my application.

0 Karma

jpolcari
Communicator

Sorry, didn't realize you were attempting to load the actual jquery file. Splunk already includes jQuery as it uses it within the application. No need to import another copy.

0 Karma

sfatnass
Contributor

ok so it's possible to load an owl carousel on html dashboard? i try it with many issue but no result

0 Karma

jpolcari
Communicator

Yes, it is possible. Sorry, I don't know too much beyond that but here are some examples of using jQuery in Splunk dashboards. Hopefully these help:

http://blogs.splunk.com/2013/10/21/toggle-visibility-of-dashboard-components-with-jquery/
http://dev.splunk.com/view/webframework-tutorials/SP-CAAAEN5

0 Karma

sfatnass
Contributor

i will check that thx for reply ^^

0 Karma

nagaraju_chitta
Path Finder

Hi ...did you get a chance to get this work? if so pls share us your experience how did you resolved it?I am alos facing the same issue.

0 Karma

sfatnass
Contributor

not yet sorry, but currently i try to resolve an important problem with hunk when i read json logs.
https://answers.splunk.com/answers/453390/how-can-i-get-multiple-source.html

0 Karma

nagaraju_chitta
Path Finder

Thanks for the quick response

0 Karma

sfatnass
Contributor

i have a problem with hunk when i try to read many sources (json content) if you have any idea about that

0 Karma

nagaraju_chitta
Path Finder

To be honest not yet tried hunk..sorry

0 Karma

sfatnass
Contributor

i think i will do a full jquery script to create a beautiful home page for my app.

i use 3 dahsboard. i just to check some idea ^^

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...