I am having two apps, Main app and Add-On app.
Add-On app contains one data collector script which works as splunk data input script and feeds data to splunk.
This data collector script is being executed at regular intervals and each time it gets sessionkey from splunk and uses it to fetch the encrypted credentials.
I have also added Custom search command in main app, there is one wrapper script for custom search command in main app, which will collect command and options and pass it to the data collector script of Add-On app.
But, whenever data collector script is being called by this wrapper, it is not able to get the sessionKey from splunk.
Below are the contents of commands.conf for custom search command.
[customCollect]
filename = customCollect.py
supports_getinfo=true
generating=true
supports_rawargs = true
outputheader = true
enableheader = true
passauth = true
streaming = false
retainsevents = true
changes_colorder = true
overrides_timeorder = false
In data collector script, I have tried below given two approaches to get sessionkey but none of them is working.
1) results,dummyresults,settings = splunk.Intersplunk.getOrganizedResults()
sessionKey = settings.get("sessionKey", None)
2) sessionKey = sys.stdin.readline().strip()
... View more