# Filebeat with JSON, set root key

**URL:** <https://discuss.elastic.co/t/filebeat-with-json-set-root-key/131734>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 14, 2018, 12:10pm UTC](https://discuss.elastic.co/t/filebeat-with-json-set-root-key/131734 "2018-05-14T12:10:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atze](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@atze](https://discuss.elastic.co/u/atze)\
**Post date:** [May 14, 2018, 12:10pm UTC](https://discuss.elastic.co/t/filebeat-with-json-set-root-key/131734/1 "2018-05-14T12:10:27Z")

</div>

Hi,

If you parse a JSON with filebeat and send it in elasticsearch, all root keys from the original json document will have the prefix `json.<fieldname>`. For example

```auto
{"status":400} -> {"json" : { "status" : 400}}

```

Right?

So can we change this `json` name to something of our own liking or should we rewrite everything using logstash/ingest. (for example `{"webservername":{"status":400}}`)

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 14, 2018, 2:46pm UTC](https://discuss.elastic.co/t/filebeat-with-json-set-root-key/131734/2 "2018-05-14T14:46:04Z")

</div>

Hi,

Currently there is no way to do it, you can only choose to write it under the `json` key or directly under root with [`json.keys_under_root: true`](https://www.elastic.co/guide/en/beats/filebeat/6.2/configuration-filebeat-options.html#config-json).

In the upcoming 6.3 release we add a new [`rename` processor](https://www.elastic.co/guide/en/beats/filebeat/6.3/rename-fields.html) that can be used to rename fields in any way.

---

<div class="post-metadata">

**Author:** ![atze](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@atze](https://discuss.elastic.co/u/atze)\
**Post date:** [May 16, 2018, 8:19am UTC](https://discuss.elastic.co/t/filebeat-with-json-set-root-key/131734/3 "2018-05-16T08:19:18Z")

</div>

Ok thnx!

---

<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:** [June 13, 2018, 8:19am UTC](https://discuss.elastic.co/t/filebeat-with-json-set-root-key/131734/4 "2018-06-13T08:19:24Z")

</div>

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