Dashboards & Visualizations

Usage of js and css in Splunk cloud

dinesh001kumar
Engager

There was an dashboard is created in Splunk Enterprise with using only HTML code along with Javascript and CSS file. Can you please help me clarify.

1.Is that Splunk Cloud will Support CSS and Js file.

2.Can we write complex HTML Code in Splunk Cloud Dashboard.

If not possible means what will be alternative solution for above, can anyone please clarify.

Also is it possible to add audio file in Studio dashboard. Since if there was drop in Success rate of transaction busser sound be initiated. 

Labels (2)
0 Karma

dinesh001kumar
Engager

I have tried this method customizing inside app and install using Install App. But i am getting JavaScript error message.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You mean you uploaded the app OK, but your JS is throwing errors or the AppInspect process failed and you could not upload the app?

0 Karma

dinesh001kumar
Engager

App was uploaded successfully, when I try to use Javascript in Splunk cloud getting error. Is there any blockage at Splunk end due to security reason, same javascript i can able to use Splunk enterprises.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Without knowing what you're trying to do, I couldn't answer that - if you managed to upload the app, then I would guess there might be some issues with your JS, but there may also be some sandbox restrictions around what you can do.

0 Karma

livehybrid
Super Champion

Hi @dinesh001kumar 

To remove any uncertainty, it *is* possible to have custom css/js within apps in Splunk Cloud, however I dont think you can upload the files via the Splunk Cloud UI, instead you will need to package the files within your custom app in <app_name>/appserver/static directory. 

Once packaged and uploaded to Splunk Cloud this should work the same as you may have previously used on-premise with Splunk Enterprise. 

For more information check out https://docs.splunk.com/Documentation/SplunkCloud/latest/AdvancedDev/UseCSS

As @bowesmana stated, if you are on Victoria experience Splunk Cloud stack then your app should sail through appsinpect without having to be manually inspected. 

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

dinesh001kumar
Engager

My requirement is to create similar in Splunk Cloud.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can upload your own app with custom JS and css in it, as long as you are on Victoria experience in the Cloud and the JS will pass the AppInspect when you upload the app.

We do this all the time and have a set of JS functions that we use for our applications that are bundled with every app we created.

Prewin27
Contributor

@dinesh001kumar 
1-Due to security restriction, normally you can't upload or reference custom js files directly in the cloud. You can raise a support request to include simple xml js extensions for review and to upload it for you.


2-You can use the <html> panel in Simple XML dashboards for custom HTML, but it is limited. Normally you cannot use inline JavaScript, and some HTML elements may be restricted.

Alternative -
Unfortunately use the built-in features of Dashboard Studio or Simple XML extensions.
For specific needs, reach out to Splunk Cloud Support to request a review and upload of vetted JS/CSS files.

Audio Support-Dashboard Studio does not natively support embedding or playing audio files. As a workaround, you could set up external alerting (e.g., send a webhook/email to a system that plays audio)

Regards,
Prewin
Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a kudos/Karma. Thanks!

0 Karma
Get Updates on the Splunk Community!

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...

Enhance Your Splunk App Development: New Tools & Support

UCC FrameworkAdd-on Builder has been around for quite some time. It helps build Splunk apps faster, but it ...