Greetings,
I don't know if u got a solution or not, but did u check the documentation about "Setting up a scripted input"?
https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptedInputsIntro
http://docs.splunk.com/Documentation/Splunk/6.1.3/AdvancedDev/ScriptSetup
... View more