Dashboards & Visualizations

Why am I unable to load an image in my app's home page in Splunk 6.2.5?

jonatanlacroix
New Member

Hi guys,

I am having issues with loading images in my application. I am trying to load a splash/full page image for my application's home page, but can't seem to get it to load. I had it working on my Django app, but now that I have gone back to the XML converted into HTML apps, seems like the image just can't be found.

My picture is present in /opt/splunk/etc/apps/Smartinventoryapp_v2/appserver/static. Just to be sure it wasn't an issue with the picture, I copied it from the previous working application.

First way I tried was:

<img src="${make_url('/static/app/Smartinventoryapp_v2/test2.png')}" alt="My splash image" />

Second attempt was:

Adding the following code in the html dashboard:

<html>
            <dashboard stylesheet="customAppStyles.css">
            <h1 id="splashID">
                      Test
            </h1>
            </dashboard>
        </html>

and created the customAppStyles.css file in the same folder as the picture:

#splashID {
        background-image: url(test2.png);
}

As you can see, no picture shows up in either case. In the first case, the placeholder text "My splash image" shows up and in the second case, the Test text shows up. If I remove the text, all I get is a blank line.

Any insight welcome!

Thanks,

j.

0 Karma
1 Solution

Yasaswy
Contributor

Hi,
/opt/splunk/etc/apps/Smartinventoryapp_v2/appserver/static is the right location.
For the first way ...try using
<img src="{{SPLUNKWEB_URL_PREFIX}}/static/app/Smartinventoryapp_v2/test2.png"> for the image.

View solution in original post

Yasaswy
Contributor

Hi,
/opt/splunk/etc/apps/Smartinventoryapp_v2/appserver/static is the right location.
For the first way ...try using
<img src="{{SPLUNKWEB_URL_PREFIX}}/static/app/Smartinventoryapp_v2/test2.png"> for the image.

Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...