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!

Financial Services Industry Use Cases, ITSI Best Practices, and More New Articles ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Splunk Federated Analytics for Amazon Security Lake

Thursday, November 21, 2024  |  11AM PT / 2PM ET Register Now Join our session to see the technical ...

Splunk With AppDynamics - Meet the New IT (And Engineering) Couple

Wednesday, November 20, 2024  |  10AM PT / 1PM ET Register Now Join us in this session to learn all about ...