From d44c2af3bd871d51b049a872f75eb2e2128d8a72 Mon Sep 17 00:00:00 2001 From: Doug Brown Date: Sat, 30 Jul 2016 12:15:22 +0000 Subject: [PATCH 1/2] Fixing missing handlers stanza in examples/searchcommands_template/default/logging.conf --- examples/searchcommands_template/default/logging.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/searchcommands_template/default/logging.conf b/examples/searchcommands_template/default/logging.conf index 39afa6518..aeaba74e2 100644 --- a/examples/searchcommands_template/default/logging.conf +++ b/examples/searchcommands_template/default/logging.conf @@ -22,6 +22,9 @@ level = NOTSET ; Default: WARNING handlers = app ; Default: stderr propagate = 0 ; Default: 1 +[handlers] +keys = app, splunklib, stderr + [handler_app] # Select this handler to log events to $SPLUNK_HOME/var/log/splunk/searchcommands_app.log class = logging.handlers.RotatingFileHandler From e934bc8f3f1f6ebb23a559f2be8726768463c334 Mon Sep 17 00:00:00 2001 From: Doug Brown Date: Sat, 30 Jul 2016 12:47:35 +0000 Subject: [PATCH 2/2] Making stream.py work without modification --- examples/searchcommands_template/bin/stream.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/searchcommands_template/bin/stream.py b/examples/searchcommands_template/bin/stream.py index 2ab2b4c1d..9277913a9 100644 --- a/examples/searchcommands_template/bin/stream.py +++ b/examples/searchcommands_template/bin/stream.py @@ -20,6 +20,7 @@ class %(command.title())Command(StreamingCommand): """ def stream(self, events): # Put your event transformation code here - pass + for event in events: + yield event dispatch(%(command.title())Command, sys.argv, sys.stdin, sys.stdout, __name__)