title: How to remove trailing newline from message field
body: <p>I am shipping Glassfish 4 logfiles with Logstash to an ElasticSearch sink. How can I remove with Logstash the trailing newline from a message field?</p>
  
  <p>My event looks like this:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "@timestamp" =&gt; "2013-11-21T13:29:33.081Z",
    "message" =&gt; "[2013-11-21T13:29:32.577+0000] [glassfish 4.0] [INFO] [] [javax.resourceadapter.mqjmsra.lifecycle] [tid: _ThreadID=142 _ThreadName=Thread-43] [timeMillis: 1385040572577] [levelValue: 800] [[\n  MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter stopped.]]\n",
    "@version" =&gt; "1",
    "tags" =&gt; ["multiline", "date_filtered"],
    "host" =&gt; "myhost",
    "path" =&gt; "../server.log"
  } 
  </code></pre>