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
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...