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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...