Dashboards & Visualizations

Can't add image to dashboard

Branden
Builder

I'm trying to add a simple image to my advanced dashboard. This is not turning out to be the easy task I thought it would be.

I have added the jpg to:

$SPLUNK_HOME/etc/apps/MyApp/appserver/static/foo.jpg

I call that img in a file called foo.html;.

Then in my dashboard I did the following:

<module name="ServerSideInclude" layoutPanel="panel_row1_col2">
  <param name="src">'foo.html'</param>
</module>

That produces the error:

ServerSideInclude Module Error!

Splunk has failed to locate the template for uri '/APP/MyApp/appserver/static/'foo.html''.

So then I tried doing this within ServerSideInclude):

<img src="${make_url('/static/app/MyApp/foo.jpg')}" alt="My image" />

That produced a similar error.

Obviously I'm doing something wrong here.

Here is the HTML I'm using (very simple):

<html>
<head></head>
<body>
    <img src="xyz.jpg" alt="xyz" />
</body>
</html>

Only the "alt" text is appearing, not the image. The image resides in the same directory as the HTML file (/splunk/etc/apps/MyApp/appserver/static/xyz.jpg)
Can anyone tell me why the image isn't appearing? 

Thanks!
Tags (2)
1 Solution

sideview
SplunkTrust
SplunkTrust

All you have to do is not put those single quote marks around the src param

<module name="ServerSideInclude" layoutPanel="panel_row1_col2">
  <param name="src">foo.html</param>
</module>

View solution in original post

sideview
SplunkTrust
SplunkTrust

All you have to do is not put those single quote marks around the src param

<module name="ServerSideInclude" layoutPanel="panel_row1_col2">
  <param name="src">foo.html</param>
</module>

Branden
Builder

I figured it out. The path to the image in the HTML has to look like this: /static/app/MyApp/xyz.jpg

Thanks all for your help!

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 ...