Assuming you have an app called 'myapp', you should place your file inside
$SPLUNK_HOME/etc/apps/myapp/appserver/static
You can then access it from SplunkWeb: http://localhost:8000/static/app/myapp/myfile.png
Alternatively, files placed inside
$SPLUNK_HOME/etc/system/static
can be accessed via SplunkD: https://localhost:8089/static/myfile.png
To clarify, http://localhost:8000/static/app/myapp/myfile.png would work for your files in $SPLUNK_HOME/myapp/appserver/static
and
http://localhost:8000/en-US/splunkd/__raw/servicesNS/admin/myapp/static/myfile.png
would work for files in $SPLUNK_HOME/myapp/static.
Make sure to use the first.
And to access the file in your myapp app, it would be:
http://localhost:8000/en-US/splunkd/__raw/servicesNS/admin/myapp/static/myfile.png
Just to add, the original posted URI still works like in
http://localhost:8000/static/app/myapp/myfile.png
Five years later things have changed a bit. Now to access /etc/system/static file you'd need to go another way:
http://localhost:8000/en-US/splunkd/__raw/servicesNS/admin/search/static/myfile.png
Assuming you have an app called 'myapp', you should place your file inside
$SPLUNK_HOME/etc/apps/myapp/appserver/static
You can then access it from SplunkWeb: http://localhost:8000/static/app/myapp/myfile.png
Alternatively, files placed inside
$SPLUNK_HOME/etc/system/static
can be accessed via SplunkD: https://localhost:8089/static/myfile.png
Hi,
Thanks for ypur response.
But what about customizing the XML of a dashboard: when i try to change its code I see that they start with the tag and not (as the simple dashboard app shows). How can I change the XML correctly?
When I copy the .css file to the directory ../statis and change the xml of the dashboard I get no results...
Thanks,
Skender,
Hi Skender,
if your .css
file is in $SPLUNK_HOME/etc/apps/YourApp/appserver/static
directory you can use it like this in your dashboard:
<form stylesheet="YourFancy.css" .... >
Correct. The above solution works fine. But if i create a folder inside appserver/static and place the css file inside, then how i will refer that in my dashboard.
eg) appserver/static/folder1/folder2/YourFancy.css
In Dashboard it should be like
form stylesheet="folder1/folder2/YourFancy.css"...
For me it is not working. Kindly suggest how to access a file if place inside a folder..