All Apps and Add-ons

keep python files inside splunk addon for packaging

sawgata12345
Path Finder

Hi,

I have created a splunk Addon with input configuration defined by Shell script.

here i refer to a shell script /home/user/Documents/bashscript/sample.sh $username$ $password$ $port$ $index$ $mgmtport$
this bash file receives textbox contents from addon UI and calls a python file which is kept at the system location

/home/user/Documents/projectfolder/receiveandupload.py
This python file receives the inputs from the bash file and starts a server connection to a port 5000 and waits to receive data from switch in raw format send via grpc using protocol buffers. this python file converts the raw format to json and sends to splunk at the index and mgmtport received from the bash file.

I can run it in edit stage with the "TEST" button as well as when I select it from left menu and then creating a input form with the text fields created during the creation of the Addon for username , password,port,index,mgmtport. When i use the enabled form Action drop down it calls the sample.sh script and it gets the input from UI and passes to python script and it also works fine by receiving the data from switch and uploads to splunk.

But when i am trying to package the add on its showing error and not creating the addon.

Is it because the python file and the bash file sample.sh is kept in Documents folder ?
Where do I keep the sample.sh file and the projectfolder containing the (protobuf files,python files, and related files) so that i can package the AddOn for distribution ?

Splunk is also installed in this same machine at location /home/user/Documents/Splunk/splunk

Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

All files related to an app (add-on) must be in the app's directory ($SPLUNK_HOME/etc/apps/ with .sh and .py files in the bin subdirectory.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

All files related to an app (add-on) must be in the app's directory ($SPLUNK_HOME/etc/apps/ with .sh and .py files in the bin subdirectory.

---
If this reply helps you, Karma would be appreciated.
0 Karma

sawgata12345
Path Finder

Hi,

Thanks it works.
But while i try to do Validata&Package it shows error "splunk there was a problem connecting to app certification service. the service might not be available at this time or you might need to verify your proxy settings".
Is there anything else I missed?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Splunk no longer certifies apps. Just package your app, don't validate it.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...