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!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...