# How to convert HEXA field into ASCII field through logstash pipeline

**URL:** <https://discuss.elastic.co/t/how-to-convert-hexa-field-into-ascii-field-through-logstash-pipeline/351771>\
**Category:** Logstash\
**Created:** [January 25, 2024, 6:30am UTC](https://discuss.elastic.co/t/how-to-convert-hexa-field-into-ascii-field-through-logstash-pipeline/351771 "2024-01-25T06:30:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![upreddy](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@upreddy](https://discuss.elastic.co/u/upreddy)\
**Post date:** [January 25, 2024, 6:30am UTC](https://discuss.elastic.co/t/how-to-convert-hexa-field-into-ascii-field-through-logstash-pipeline/351771/1 "2024-01-25T06:30:39Z")

</div>

Hi All,  
we are getting one filed in the form of hexa i need to convert that filed into ASCII through logstash pipeline. Could you please guide me on this?  
eg:- "abc": "8a64756c656173654368616e"  
I need to convert "abc" field value into ASCII.  
Thanks

---

<div class="post-metadata">

**Author:** ![yago82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yago82/32/97755_2.png) [@yago82](https://discuss.elastic.co/u/yago82)\
**Post date:** [January 25, 2024, 9:44am UTC](https://discuss.elastic.co/t/how-to-convert-hexa-field-into-ascii-field-through-logstash-pipeline/351771/2 "2024-01-25T09:44:11Z")

</div>

Hi,

you can use the Ruby filter plugin

Example:

```auto
filter {
  ruby {
    code => "
      field_value = event.get('abc')
      if field_value
        ascii_value = [field_value].pack('H*')
        event.set('abc', ascii_value)
      end
    "
  }
}

```

Regards

---

<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:** [February 22, 2024, 9:44am UTC](https://discuss.elastic.co/t/how-to-convert-hexa-field-into-ascii-field-through-logstash-pipeline/351771/3 "2024-02-22T09:44:53Z")

</div>

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