# Event API ; event.remove() does not work on key with special character ? encoding problem?

**URL:** <https://discuss.elastic.co/t/event-api-event-remove-does-not-work-on-key-with-special-character-encoding-problem/157432>\
**Category:** Logstash\
**Created:** [November 19, 2018, 8:35pm UTC](https://discuss.elastic.co/t/event-api-event-remove-does-not-work-on-key-with-special-character-encoding-problem/157432 "2018-11-19T20:35:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ljak/32/40307_2.png) [@ljak](https://discuss.elastic.co/u/ljak)\
**Post date:** [November 19, 2018, 8:35pm UTC](https://discuss.elastic.co/t/event-api-event-remove-does-not-work-on-key-with-special-character-encoding-problem/157432/1 "2018-11-19T20:35:03Z")

</div>

Hi there,

From the CouchDB input plugin, logstash receives this document:

```
{
  "_id": "542de4069541c1fc76a649a9fe0377c0",
  "_rev": "28-8fb537085cf219b74d13d58400245267",
  "type": "test",
  "message": "message test",
  "test": "test",
  "ExposureinµAs": 1300
}

```

(Notice the special character `µ` inside the `ExposureinµAs` key).

I tried to remove this field with the Ruby filter.

```
filter {
  if ([doc] and [doc][type] == "test"){
    ruby { 
      code => "
      event.remove('[doc][ExposureinµAs]')
      " 
    } 
  } else {
    drop {}
  }
}

```

And it does not work. I guest an encoding problem.

I searched on the web to find the root of it; indeed, the problem could come from either  
the Ruby Logstash Plugin, or Jruby or Java. But I did not find anything.

Note that I tried this logstash config with Logstash 6.2.4 and it works. But I'm curious and actually,  
I do not have the time to update the entire Elastic stack, so I would like to find a little fix (if possible)

Thanks !

---

<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:** [December 17, 2018, 8:35pm UTC](https://discuss.elastic.co/t/event-api-event-remove-does-not-work-on-key-with-special-character-encoding-problem/157432/2 "2018-12-17T20:35:04Z")

</div>

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