Splunk Dev

Access the static images in app path

phil__tanner
Path Finder

Hi all 

I'm creating a custom visualisation for my org, so I'm developing it into an app, following this tutorial:
https://docs.splunk.com/Documentation/Splunk/8.0.5/AdvancedDev/CustomVizTutorial

Everything's great so far and working perfectly on my local machine when I'm referencing a background image in my CSS using:

background-image: url( '/static/app/********/images/hot-water-icon.gif' );

(obviously ******** is the name of my app, on my local machine).

This is great, until I sent an upgrade to test on another machine, where it got installed into an app directory called "******** - Copy" (I assume because that was the name of the file of the folder I copied to zip & send thru, because I didn't want to send some other things in the /static/app/********/bin/ folder I was still working on at the time....)

So... How do I access the URI for the named app install folder? Can it be done? or do I just need to presume it'll always be as I set it?

Thanks in advance,
Phil

0 Karma

aa70627
Communicator

have you tried using a relative URL as either

background-image: url( 'images/hot-water-icon.gif' );

OR 

background-image: url( 'hot-water-icon.gif' );

 

 

0 Karma

phil__tanner
Path Finder

Unfortunately that's not going to work as we plan on using the visualisation in many dashboards, and across multiple embedded reports - which of course have URLs outside of the particular app (and the visualisation is marked as being set to be available globally within the instance).

0 Karma

aa70627
Communicator

try this:

background-image: url( '/en-US/static/app/{yourapp}/images/simple_chart.png' );

no matter which app your using this from, it should still work as long as you replace {yourapp} with the actual app where the image resides. 

 

0 Karma

phil__tanner
Path Finder

Thanks Path Finder.

Unfortunately, that's my question - for my local dev {yourapp} is one value. But when testing on another machine, they have installed it (somehow) into {yourapp - Copy}  - I'm trying to work out if I can programmatically access what value {yourapp} has been set to on the currently running install.

I think the answer is "no", and my edge case is so edge-casey that it wouldn't be worth developing anything for.

Phil.

0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...