Splunk Search

Dashboard table styling?

szabados
Communicator

I want to adapt a script from the XML examples to a dashboard of mine.
When I add the script="" stylesheet="" line do the XML, it works, but after changing something in the *.js, by dashboard is broken:
The search can't run, the submit button gets inactive, and the Edit Panel, Edit source buttons disappear.

Any ideas ?

Tags (4)

aljohnson_splun
Splunk Employee
Splunk Employee

If you know that you changed something in the *.js, and it broke, just go backwards and find out which change broke the dashboard.

0 Karma

tmarlette
Motivator

that means your confusing the simple XML jscripts in the backend, or ignoring them all together. When the 'edit' buttons dissapear, splunk stops using those jscripts.

Honestly, I would assume the jscript is missing something and/or broken, however that's an assumption.

also, you should just have to 'share' the dashboard example apps knowledge objects in order to access things within, so make sure the permissions are set accordingly, otherwise your app won't be able to read the script.

szabados
Communicator

After installing the sample app, I tried to use the script from it, just for testing.
Added to the xml:
<dashboard script="simple_xml_examples:table_cell_highlighting.js" stylesheet="simple_xml_examples:table_cell_highlighting.css">

The issuse still persist.
The sample app is shared globally, with the read permissions for everyone

0 Karma

tmarlette
Motivator

Maybe try moving the desired script to:
/opt/splunk/etc/apps/<yourApp>/appserver/static?

I see you're using 'dashboard script'. The format that has worked for me on a simple xml dashboard is as follows:
<form script="yourScript1.js, yourScript2.js, yourScript3.js" stylesheet="yourStyleSheet1.css, yourStyleSheet2.css">

szabados
Communicator

For the first try, I've done that, but no luck

0 Karma

tmarlette
Motivator

when I added the .css file to my app itself, this began working. I was calling a single icon as opposed to the value.

I moved the .css file from it's locat (/opt/splunk/etc/app/simple_xml_reference/appserver/static) to my app:
(/opt/splunk/etc/apps/<myApp>/appserver/static)

Restart your search head after you do this, or wait (for awhile) until it takes, but your dashboard that is referencing this .css should work.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...