# Messages with html code from rsyslog corrupted

**URL:** <https://discuss.elastic.co/t/messages-with-html-code-from-rsyslog-corrupted/58308>\
**Category:** Logstash\
**Created:** [August 18, 2016, 4:42am UTC](https://discuss.elastic.co/t/messages-with-html-code-from-rsyslog-corrupted/58308 "2016-08-18T04:42:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Binbin\_He](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/binbin_he/32/73993_2.png) [@Binbin\_He](https://discuss.elastic.co/u/Binbin_He)\
**Post date:** [August 18, 2016, 4:42am UTC](https://discuss.elastic.co/t/messages-with-html-code-from-rsyslog-corrupted/58308/1 "2016-08-18T04:42:43Z")

</div>

I use rsyslog to collect all server logs to logstash. But these days I found some log with html code will be corrupted by logstash. Here are the details below.

Logstash version: 2.3.4  
Rsyslog version: 8.20.2

Message example in rsyslog:

```auto
Aug 17 12:36:41 unstable-util-service-9adxp4yimtsjw jettyLog: 2016-08-17 12:36:09 INFO LoggerFilter:85 - [200] /utils/mgt/bulletin {"data":[{"bulletinId":"2016080300000006","bulletinType":2,"top":1,"publish":1,"important":0,"source":"","title":"点理财“注册送5000元体验金”活动重磅来袭！","summery":"点理
财平台一直奉行客户至上的准则，致力于为客户提供更好的投资体验。为回报广大投资用户的支持及信任，点理财>平台特举办“注册送5000元体验金”活动，活动于7月27日正式上线！体验金数量有限，五千万体验金送完为止。快来
参与吧！","content":"<p style=\"margin-top:0;margin-right:0;margin-bottom:32px;margin-left:0;text-indent:28px\"><span style=\"color: rgb(0, 0, 0); font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; font-size: 16px;\"><span style=\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); background: rgb(255, 255, 255);\">点理财平台一直奉行客户至上的准则，致力于为客户提供更好的投资体验。</span><span style=\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); letter-spacing: 0px; background: rgb(255, 255, 255);\">为回报广大投资用户的支持及信任，点理财平台特举办“</span><span style=\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(255, 0, 0);\">....(not full)

```

Message received in logstash:

```auto
Received an event that has a different character encoding than you configured. {:text=>"{ \\\"msg\\\": \\\" 2016-08-17 12:36:09 INFO LoggerFilter:85 - [200] \\\\/utils\\\\/mgt\\\\/bulletin {\\\\\\\"data\\\\\\\":[{\\\\\\\"bulletinId\\\\\\\":\\\\\\\"2016080300000006\\\\\\\",\\\\\\\"bulletinType\\\\\\\":2,\\\\\\\"top\\\\\\\":1,\\\\\\\"publish\\\\\\\":1,\\\\\\\"important\\\\\\\":0,\\\\\\\"source\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"title\\\\\\\":\\\\\\\"点理财“注册送5000元体验金”活动重磅来袭！\\\\\\\",\\\\\\\"summery\\\\\\\":\\\\\\\"点理财平台一直奉行客户至上的准则，致力于为客户提供更好的投资体验。为回报广大投资用户的支持及信任，点理财平台特举办“注册送5000元体验金”活动，活动于7月27日正式上线！体验金数量有限，五千万体验金送完为止。快来参与吧！\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"<p style=\\\\\\\\\\\\\\\"margin-top:0;margin-right:0;margin-bottom:32px;margin-left:0;text-indent:28px\\\\\\\\\\\\\\\"><span style=\\\\\\\\\\\\\\\"color: rgb(0, 0, 0); font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; font-size: 16px;\\\\\\\\\\\\\\\"><span style=\\\\\\\\\\\\\\\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); background: rgb(255, 255, 255);\\\\\\\\\\\\\\\">点理财平台一直奉行客户至上的准则，致力于为客户提供更好的投资体验。<\\\\/span><span style=\\\\\\\\\\\\\\\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); letter-spacing: 0px; background: rgb(255, 255, 255);\\\\\\\\\\\\\\\">为回报广大投资用户的支持及信任，点理财平台特举办“<\\\\/span><span style=\\\\\\\\\\\\\\\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(255, 0, 0);\\\\\\\\\\\\\\\"><strong><span style=\\\\\\\\\\\\\\\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); letter-spacing: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;\\\\\\\\\\\\\\\">注册送<\\\\/span><\\\\/strong><strong><span style=\\\\\\\\\\\\\\\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); letter-spacing: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;\\\\\\\\\\\\\\\">5000元体验金<\\\\/span><\\\\/strong><\\\\/span><span style=\\\\\\\\\\\\\\\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); letter-spacing: 0px; background: rgb(255, 255, 255);\\\\\\\\\\\\\\\">”活动，活动于7月27日正式上线！体验金数量有限，五千万体验金送完为止。快来参与吧！<\\\\/span><span style=\\\\\\\\\\\\\\\"font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; color: rgb(0, 0, 0); letter-spacing: 0px; text-indent: 32px; background-color: rgb(255, 255, 255);\\\\\\\\\\\\\\\">&nbsp;<\\\\/span><\\\\/span>...(not full)", :expected_charset=>"UTF-8", :level=>:warn}

```

Rsyslog config:

```auto
template(name="json-template"
  type="list") {
        property(name="jsonmesg")
}
*.* @10.17.9.55:10514;json-template

```

logstash config:

```auto
input {
  udp {
    host => "10.17.9.55"
    port => 10514
    codec => "json"
    type => "rsyslog"
  }
}
output {
  elasticsearch {
    hosts => ["127.0.0.1:9200"]
  }
}

```

Anyone who can help? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:42am UTC](https://discuss.elastic.co/t/messages-with-html-code-from-rsyslog-corrupted/58308/2 "2017-07-06T04:42:56Z")

</div>


