From 6729a5b58383d4fea9dab7b3e7bb027ed55d8ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Ortiz=20de=20Urbina=20Cazenave?= Date: Thu, 10 Sep 2015 11:50:46 +0200 Subject: [PATCH] Add second example to ScribbleDecoder While there, also make a explicit comment regarding the current implementation of the sandboxed lua decoders, which will discard previously scribbled fields --- docs/source/config/decoders/scribble.rst | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/source/config/decoders/scribble.rst b/docs/source/config/decoders/scribble.rst index 3c7a96155..4b381c714 100644 --- a/docs/source/config/decoders/scribble.rst +++ b/docs/source/config/decoders/scribble.rst @@ -31,6 +31,33 @@ Config: Example (in MultiDecoder context) +.. code-block:: ini + + [AccesslogDecoder] + type = "MultiDecoder" + subs = ["AccesslogApacheDecoder", "EnvironmentScribbler"] + cascade_strategy = "all" + log_sub_errors = true + + [AccesslogApacheDecoder] + type = "SandboxDecoder" + filename = "lua_decoders/apache_access.lua" + + [AccesslogApacheDecoder.config] + type = "combinedio" + user_agent_transform = true + user_agent_conditional = true + log_format = '%h %l %u %t %m \"%U\" \"%q\" \"%H\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %I %O' + + [EnvironmentScribbler] + type = "ScribbleDecoder" + + [EnvironmentScribbler.message_fields] + Environment = "production" + +You can also add static fields to messages decoded by a downstream heka instance +that forwards messages for further processing. + .. code-block:: ini [mytypedecoder] @@ -46,3 +73,7 @@ Example (in MultiDecoder context) [mytype.message_fields] Type = "MyType" + +Message scribbling is commonly performed after the lua sandboxed decoders have been +applied. Otherwise the scribbled field may get discarded, depending on the +decoder implementation.