Splunk Dev

Is Relative import allowed in splunk app ?

ahmad1950
Engager

Absolute imports:
from utils import get_log
Relative imports:
from .utils import get_log

This import line is in  splunk/etc/apps/my_app/bin/
myapp.py
path of utils                   splunk/etc/apps/my_app/bin/utils.py

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@ahmad1950 - I have not tested it specifically. But I think you should be able to use all the features of Python as you use external Python.

 

I hope this helps!!!

Get Updates on the Splunk Community!

OpenTelemetry for Legacy Apps? Yes, You Can!

This article is a follow-up to my previous article posted on the OpenTelemetry Blog, "Your Critical Legacy App ...

UCC Framework: Discover Developer Toolkit for Building Technology Add-ons

The Next-Gen Toolkit for Splunk Technology Add-on Development The Universal Configuration Console (UCC) ...

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...