README.md in fluent-plugin-unix-client-0.1.0 vs README.md in fluent-plugin-unix-client-1.0.0

- old
+ new

@@ -46,12 +46,24 @@ The payload is read up to this character. Default value: `"\n"` (newline). +### format_json (bool) (optional) + +When recieved JSON data splitted by the delimiter is not completed, like '[{...},', trim '[', ']' and ',' characters to format. + +Please see `Sample` below for details. + +Default value: false. + ## Sample +### For JSON + +Config: + ``` <source> @type unix_client tag debug.unix_client path /tmp/unix.sock @@ -62,9 +74,56 @@ </source> <match debug.**> @type stdout </match> +``` + +Assumed Data: + +* ndjson +``` +{"key":0}\n +{"key":0}\n +... +``` + +* JSON list +``` +[{"key":0}, {"key":0}, ...]\n +[{"key":0}, {"key":0}, ...]\n +... +``` + +### Use `format_json` + +Config: + +``` +<source> + @type unix_client + tag debug.unix_client + path /tmp/unix.sock + <parse> + @type json + </parse> + delimiter "\n" + format_json true +</source> + +<match debug.**> + @type stdout +</match> +``` + +Assumed Data: + +``` +[{"key":0},\n +{"key":0},\n +... +{"key":0}]\n +... ``` ## Specification * This recieves data from UNIX domain socket which **is opened by another application**.