# SNMPTRAP OCTET String to String

**URL:** <https://discuss.elastic.co/t/snmptrap-octet-string-to-string/80689>\
**Category:** Logstash\
**Created:** [March 30, 2017, 1:52pm UTC](https://discuss.elastic.co/t/snmptrap-octet-string-to-string/80689 "2017-03-30T13:52:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)\
**Post date:** [March 30, 2017, 1:52pm UTC](https://discuss.elastic.co/t/snmptrap-octet-string-to-string/80689/1 "2017-03-30T13:52:02Z")

</div>

When I use SNMPTRAP to get SNMP messages.  
The message includes below  
"\xE9\x80\x9A\xE4\xBF\xA1\xE8\xB4\xA8\xE9\x87\x8F", which has been confirmed the type 'utf8' through the filter ruby command 'puts event.get('message').encoding'.  
It should be Chinese.  
Can anyone help with how to convert the OCTET string to regular string, and displays as Chinese.

---

<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:** [April 27, 2017, 1:52pm UTC](https://discuss.elastic.co/t/snmptrap-octet-string-to-string/80689/2 "2017-04-27T13:52:03Z")

</div>

Closed on April 27, 2017, 1:52pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
