No problem dear splunkers ,
I have figured it on my own
For this all we just need to write one python script and mention that script name in commands.conf
and for printing the output to splunk screen we need to import Intersplunk.py and use the outputresults method of it
#!/opt/splunk/bin/python2.7
import sys
sys.path.insert(0,'/opt/splunk/lib/python2.7/site-packages/splunk/')
import Intersplunk as man
result = []
results = {
"Name": "Manish"
}
result.append(results)
man.outputResults(result)
f = open('hello.txt','a')
f.write(str(result))
f.write('\n')
f.close()
... View more