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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...