|
Following on from http://splunk-base.splunk.com/answers/30462/best-practice-logging-script-runtime-results I have been having difficulties implementing a suggestion. Quick summary, I am building a custom search but I keep enountering problems along the way. At the moment I am trying to log issues as I go along but I cannot get any logging import or sys.stderr to work. Logging outputs nothing to python.log (permissions are all fine) and using stderr isn't outputting anything to splunkd.log, even when the script is working and running through from start to finish. I would appreciate any ideas as I cannot get my head around what is going on with it, I just need some feedback to find other problems! |
|
I think I can clear this up for you. Standard error (stderr) gets logged to the If you are trying to create a custom search command, then the easiest approach I'd suggest adding the following code to the top of your python script:
(You can also use "python.log" if you want, there's nothing stopping you; but you may want to make sure that you use the same Then simply change any Hope that helps. Thanks! That clears that up, I think I made assumptions along the way that anything python was handled by the interpreter in the same way so I didn't clearly specify between if I was doing custom searches or scripts. I will try this tomorrow but it certainly explains my results
(27 Sep '11, 12:45)
Drainy
|
