I have created a Addon using the AddonBuilder in splunk.
it has three tabs Inputs|Configuration|Search
In the inputs tab a button appears "Create New Input". I want to add one more button just beside it and on click of the event i want to stop a python script.
While creating the Addon in the "Configure Data Collection " section I choose "Modular Inputs as Shell commands". there in the "Data Inputs Definition" tab i given
inside the .sh file:
/home//application/app1/test.py & (this starts it as daemon. the test.py has internal loop which keeps waiting for input, once it receives input it formats data and send to splunk at a specific index)
This .sh file is starting a python script in background which keeps on running.
In the Addon we have enable/disable option to prevent Splunk executing testmain.sh after every interval(mandatory to provide), but I want to kill python process by adding a button beside the "Create New Input". on click of the button it should stop the python script.
I can however again enable the python script from the Addon UI enable/disable option of the Actions.
How do I add the button and send an event so in backend it kills the python file.
ok, cant we send any rest call or edit the " another component" to add one more line same as for "Create New Input". This "another component " will also be present inside the addon folder created as "TA-sampleapp" or those components are defined in some other location?
Is it possible to create a App instead of Addon and do the above?
I created a "SampleApp", in backend it also created similar folder "TA-sampleapp". Is it possible to add one button for start and one button for stop?
I changed the config files in the default and local folders but nothing is changing on the UI.
The data input configuration UI framework has both frontend components and backend rest endpoints. It's not easy to figure out a quick solution by "hacking" existing framework, otherwise it's more like a feature request.