Building for the Splunk Platform

Why when installing custom made app that contains symlinks, the GUI removes all the links an breaks the app?

joshiro
Path Finder

We are installing a custom made app that contains some symlinks, but were having the following problem:
Installing it from the web GUI removes all the links breaking the app.
But installing it by copying the app dir into '$SPLUNK_HOME/etc/apps'  keeps the symlinks intact, and the app works.

Is this intended behaviour?
Is there anyway to use symlinks inside an app?

Regards,
Javier.

Labels (2)
Tags (2)
0 Karma
1 Solution

joshiro
Path Finder
0 Karma

mcmaster
Communicator

If this is a custom app and one you're not intending to publish to Splunkbase, one option is that you could bundle the anaconda environment in its own tgz within the app, and create a custom setup process that will extract that environment. It's clunky but that's an option.

joshiro
Path Finder

We already tried something similar installing the app directly by extracting its contents to /etc/apps, and it works. But we re eventually going to publish to splunkbase, so thats not an option.

Thanks for commenting.

0 Karma

PickleRick
Ultra Champion

Why would you want a symlink within an app in the first place? Do you have duplicated files/directories in your app? Seems badly designed. Are you reaching outside of your app? Even worse design - an app should be self-contained so you can move it to another installation.

I wouldn't count on splunk's app unpacker and various methods of app distribution (deployer, deployment server, cluster manager) to preserve symlinks anyway.

joshiro
Path Finder

Thanks for commenting on this issue.

I know its badly designed but the thing is we need to run some custom commands that uses cython, but Splunk's python doesn't support cython libraries, so we created an anaconda environment inside the app that contains another python3 instance with the cython libraries we need. This anaconda environment automatically creates some symlinks to binaries and libraries inside this environment.

This method of bypassing the Splunks python environment to run not supported libraries was used by the 'Python for Scientific Computing' app (https://splunkbase.splunk.com/app/2882/) and the Splunk Machine Learning Toolkit app (https://splunkbase.splunk.com/app/2890/) and we just copied it. But this implementation removes the symlinks by copying the same binaries and libraries creating duplicated files and wasting disk space.

So we need to find another way to run cython libraries inside Splunk, or keep the anaconda environment and try to make the symlinks work. Or we might just duplicate the bins and libs inside the anaconda just like the apps i mentioned earlier, but im trying to avoid it.

Tags (2)
0 Karma

joshiro
Path Finder

We solved this problem using the Python for Scientific Computing environment.
https://community.splunk.com/t5/Developing-for-Splunk-Enterprise/How-to-run-python-custom-commands-w...

0 Karma
Get Updates on the Splunk Community!

Introducing Ingest Actions: Filter, Mask, Route, Repeat

WATCH NOW Ingest Actions (IA) is the best new way to easily filter, mask and route your data in Splunk® ...

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...