# FileBeat 5 - Parsing JSON - Why can't it parse the whole line

**URL:** <https://discuss.elastic.co/t/filebeat-5-parsing-json-why-cant-it-parse-the-whole-line/64021>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 26, 2016, 3:02pm UTC](https://discuss.elastic.co/t/filebeat-5-parsing-json-why-cant-it-parse-the-whole-line/64021 "2016-10-26T15:02:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yarden\_Bar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yarden_bar/32/736_2.png) [@Yarden\_Bar](https://discuss.elastic.co/u/Yarden_Bar)\
**Post date:** [October 26, 2016, 3:02pm UTC](https://discuss.elastic.co/t/filebeat-5-parsing-json-why-cant-it-parse-the-whole-line/64021/1 "2016-10-26T15:02:18Z")

</div>

Hi,  
As [documented](https://www.elastic.co/guide/en/beats/filebeat/5.0/configuration-filebeat-options.html#config-json), in order to parse json line logs, the json object must contain a key to pull the message object from.

Is there a particular reason that FB won't have the ability to parse the whole line (assuming that its a valid JSON object)?

Thank you,  
Yarden

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [October 26, 2016, 8:37pm UTC](https://discuss.elastic.co/t/filebeat-5-parsing-json-why-cant-it-parse-the-whole-line/64021/2 "2016-10-26T20:37:58Z")

</div>

> [@Yarden\_Bar](#):
>
> Is there a particular reason that FB won't have the ability to parse the whole line (assuming that its a valid JSON object)?

It will parse the whole JSON object and include it in the event.

> [@Yarden\_Bar](#):
>
> As documented, in order to parse json line logs, the json object must contain a key to pull the message object from.

The `message_key` is optional. "If no text key is defined, the line filtering and multiline features cannot be used."

---

<div class="post-metadata">

**Author:** ![Yarden\_Bar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yarden_bar/32/736_2.png) [@Yarden\_Bar](https://discuss.elastic.co/u/Yarden_Bar)\
**Post date:** [October 27, 2016, 2:25pm UTC](https://discuss.elastic.co/t/filebeat-5-parsing-json-why-cant-it-parse-the-whole-line/64021/3 "2016-10-27T14:25:40Z")

</div>

Thank you, @andrewkroh !

Its working as expected 😄

---

<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:** [November 16, 2016, 3:02pm UTC](https://discuss.elastic.co/t/filebeat-5-parsing-json-why-cant-it-parse-the-whole-line/64021/4 "2016-11-16T15:02:32Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
