Dashboards & Visualizations

Add image on dashboard

samlinsongguo
Communicator

I am trying add an image in my dashboard following the link below
http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML
Use an image file in a dashboard panel

Step1 Put the image file in the following directory.
$SPLUNK_HOME/etc/apps/<appname>/appserver/static/images
If an /images directory does not already exist, create one and put the file in it.

Step 2 Verify that the image file path is accessible by testing the following URL.
http://<host>:<port>/static/app/<app_name>/images/<image>;
For example, use this URL to verify that the my_image.png file is accessible.

http://localhost:8000/static/app/search/images/my_image.png
Step 3 In the <html> panel, use this syntax to indicate a file from the current app context.
<html>
<img src="/static/app/search/images/<file_name>.png">
</img>
</html>

I have problem on step 2 where ask to verify that the image file path is accessible.

Any suggestion where I can fix that?

Thanks in advance

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi samlinsongguo,
at first put your image in $SPLUNK_HOME/etc/apps/appserver/static and then use a code like the following:

<panel>
  <html>
      <div style="width:100%;height:100%;text-align:center;">
          <img src="/static/app/myapp/myimage.png" style="height:80px;border;0;"/>
      </div>
    </html>
</panel>

Beware to the dimensions of your image.

Bye.
Giuseppe

samlinsongguo
Communicator

my splunk install does not have folder /etc/apps/appserver. I created the folder /appserver/static but still cant see the image. I think I put the image everywhere/ all possible fodlers but still cant refer to it. is that something on my server setting like IIS settings I need to change?
Thanks
Sam

0 Karma

gcusello
SplunkTrust
SplunkTrust

did you restarted or bumped your Splunk after folder creating and image adding?
I usually use this method and I display images.
Beware to the dimensions of your image in file, resize it to the dimensions you want.
Bye.
Giuseppe

0 Karma

frechette
Explorer

I think he meant to say $SPLUNK_HOME/etc/apps/appserver/static.
And the image src would be "/static/app/image.png".

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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