title: how to combine multiline docker log into one fluentd event
body: <p>Hope someone could help me because this problem has confused me for several days...</p>
  
  <p>I'm using fluentd to centralize docker container's logs. so I set docker run options:</p>
  
  <pre><code>log-driver=fluentd
  log-opt=fluentd-address=fluentd.marathon.mesos:24224
  log-opt=tag=server
  log-opt=fluentd-async-connect=true
  </code></pre>
  
  <p>and received json objects like</p>
  
  <pre><code>{container_id:xxx, container_name:xxx, log:xxx, ...}
  </code></pre>
  
  <p>for example a java exception stack trace will be like this:</p>
  
  <pre><code>{log:exampleException:error, ...}
  {log:\tat java.xxx, ...}
  {log:\tat java.xxx, ...}
  </code></pre>
  
  <p>Now my question is: how can I combine them together? Like multline in logstash.</p>
  
  <p>The correct answer I'm expecting is:</p>
  
  <pre><code>{log:exampleException:error\n\tat java.xxx\n\tat java.xxx, ...}
  </code></pre>
  
  <p>My fluentd input is in_forward not in_tail, so from the document I can't use the multiline plugin built in fluentd core.</p>
  
  <p>Then I found this plugin <a href="https://github.com/quick-sort/fluent-plugin-multiline-parser" rel="nofollow">https://github.com/quick-sort/fluent-plugin-multiline-parser</a></p>
  
  <p>But because my log received from docker doesn't contain '\n' at the end of each line, this plugin combined all my log into only one line!</p>
  
  <p>e.g. I use the word "Exception" to mark the firstline, but the answer I get is:</p>
  
  <pre><code>{log:Exception:error\tat java.xxx\tat java.xxx, ...}
  </code></pre>
  
  <p>It treated my docker log as a single line and seperated them by word "Exception"</p>
  
  <p>I have tried to add a '/n' to every log by filter record_transformer, but the filter changed my '\n' into '\\n'automatically, so it also fails</p>
  
  <p>I also find a plugin <a href="https://github.com/okkez/fluent-plugin-concat" rel="nofollow">https://github.com/okkez/fluent-plugin-concat</a> but have problem installing this plugin</p>
  
  <p>Recently I haven't found any method</p>