# Field name cannot contain '.'

**URL:** <https://discuss.elastic.co/t/field-name-cannot-contain/33251>\
**Category:** Logstash\
**Created:** [October 29, 2015, 2:05pm UTC](https://discuss.elastic.co/t/field-name-cannot-contain/33251 "2015-10-29T14:05:04Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Gary\_Hodgson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gary_hodgson/32/5619_2.png) [@Gary\_Hodgson](https://discuss.elastic.co/u/Gary_Hodgson)\
**Post date:** [November 4, 2015, 7:39pm UTC](https://discuss.elastic.co/t/field-name-cannot-contain/33251/14 "2015-11-04T19:39:59Z")

</div>

Hi,

Ah yes, sorry I don't really know ruby that well. The following will replace all dots:

```
ruby {
        code => "
          event.to_hash.keys.each { |k| event[k.gsub('.','_')] = event.remove(k) if k.include?'.' }
        "
    }

```

Best regards,  
Gary

---

_[View the full topic](https://discuss.elastic.co/t/field-name-cannot-contain/33251)._
