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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...