I want to add a command to my add on, with the aim of passing the splunk spl query results to that command, and then processing it to return the data to splunk's statistical information.
there is my spl command:index="test" | stats count by asset | eval to_query=asset | fields to_query | compromiseBut the processing of requests in my command is synchronous, which consumes a lot of time
[
{
"alert_name": "aaaaaaaaaaaa",
"campaign": "",
"confidence": "",
"current_status": "",
},
{
"alert_name": "bbbbbbbbbbbb",
"campaign": "",
"confidence": "",
"current_status": "",
}
]
You may find our documentation on custom search commands helpful: https://dev.splunk.com/enterprise/docs/devtools/customsearchcommands/
This topic includes some useful information on building different types of custom search commands as well as links to examples.
Synchronous processing is the norm for a streaming command. Perhaps you want a reporting command. See the bottom of https://docs.splunk.com/DocumentationStatic/PythonSDK/1.7.4/index.html for command types.