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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Forwarder Topology Guidance: Intermediate HF vs Intermediate UF

Why Universal Forwarders Should Not Be Used as Intermediate Forwarders A practical Splunk forwarding topology ...

At .conf26, Don’t Just See What’s Next. Help Shape It at Innovation Labs.

Long before a new capability reaches the keynote stage, it begins as an idea waiting to be tested. At ...

Data Management Digest – August 2026

Data Management Digest   Welcome to the August 2026 edition of Data Management Digest! August was a big month ...