From 9f835c8a7d9fe21dd7667183b6b6c6800e26008b Mon Sep 17 00:00:00 2001 From: kayrus Date: Fri, 14 Nov 2014 17:07:42 +0100 Subject: [PATCH] Added PIPE field separator --- README.md | 4 ++-- lib/fluent/mixin/plaintextformatter.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43c6a8a..6382648 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This module provides features to: * format whole data as serialized JSON, single attribute or separated multi attributes * include time as line header (formatted by time_format in UTC(default) or localtime), or not * include tag as line header (remove_prefix available), or not -* change field separator (TAB(default), SPACE, COMMA or SOH(\\001)) +* change field separator (TAB(default), SPACE, COMMA, SOH(\\001) or PIPE) * add new line as termination, or not ## Usage @@ -74,7 +74,7 @@ Provided configurations are below: * 'json': output by JSON * 'ltsv': output by LTSV, see: http://ltsv.org/ * 'attr:key1,key2,key3': values of 'key1' and 'key2' and ..., with separator specified by 'field_separator' -* field\_separator [TAB/SPACE/COMMA/SOH] +* field\_separator [TAB/SPACE/COMMA/SOH/PIPE] * add_newline [yes/no] * time_format * format string like '%Y-%m-%d %H:%M:%S' or you want diff --git a/lib/fluent/mixin/plaintextformatter.rb b/lib/fluent/mixin/plaintextformatter.rb index dd572fe..f8e80a0 100644 --- a/lib/fluent/mixin/plaintextformatter.rb +++ b/lib/fluent/mixin/plaintextformatter.rb @@ -30,6 +30,7 @@ def configure(conf) when /SPACE/i then ' ' when /COMMA/i then ',' when /SOH/i then "\x01" + when /PIPE/i then '|' else "\t" end