# Fielbeat only send line by line instead the whole new log entry at once

**URL:** https://discuss.elastic.co/t/fielbeat-only-send-line-by-line-instead-the-whole-new-log-entry-at-once/41177
**Category:** Beats
**Tags:** filebeat
**Created:** [February 8, 2016, 11:53am UTC](https://discuss.elastic.co/t/fielbeat-only-send-line-by-line-instead-the-whole-new-log-entry-at-once/41177 "2016-02-08T11:53:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Pablo\_perez](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Pablo\_perez](https://discuss.elastic.co/u/Pablo_perez)
#### Post date: [February 8, 2016, 11:53am UTC](https://discuss.elastic.co/t/fielbeat-only-send-line-by-line-instead-the-whole-new-log-entry-at-once/41177/1 "2016-02-08T11:53:52Z")

</div>

Let´s say that I have a cluster where I´m sending logs line from filebeat to logstash.  
My problem is that filebeat since send line by line, and in my logstash I have configure that the input codec is json, my logstash is throwing a \_jsonparsefailure since my json as I said in two lines has a wrong format.  
Any idea if it is possible send the whole entry log as once and not line by line?. It´s really weird the current behavior of filebeat, I was expecting that If I add a several lines in my log at once, filebeat will send all those at the same time, and not line by line.  
Maybe I´m doing something wroing here.

Regards.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [February 8, 2016, 12:04pm UTC](https://discuss.elastic.co/t/fielbeat-only-send-line-by-line-instead-the-whole-new-log-entry-at-once/41177/2 "2016-02-08T12:04:21Z")

</div>

Filebeat generally treats each line in the log file as a separate event, but if you are using the latest version you can configure it to [assemble records spanning multiple lines](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration-details.html#multiline) using regular expressions.

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [February 9, 2016, 12:49am UTC](https://discuss.elastic.co/t/fielbeat-only-send-line-by-line-instead-the-whole-new-log-entry-at-once/41177/3 "2016-02-09T00:49:40Z")

</div>

most log-shippers work line by line. filebeat has a multiline support for connecting multiple lines into one event.

Can you configure your application to not pretty-print the json?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [February 9, 2016, 7:53pm UTC](https://discuss.elastic.co/t/fielbeat-only-send-line-by-line-instead-the-whole-new-log-entry-at-once/41177/4 "2016-02-09T19:53:32Z")

</div>

> I was expecting that If I add a several lines in my log at once, filebeat will send all those at the same time, and not line by line.

File systems don't work that way. Filebeat has _no way_ of knowing that the application writing to the log wrote two lines in one "transaction".

---

<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: [July 5, 2017, 9:55pm UTC](https://discuss.elastic.co/t/fielbeat-only-send-line-by-line-instead-the-whole-new-log-entry-at-once/41177/5 "2017-07-05T21:55:53Z")

</div>


