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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...