# Truncating multi line

**URL:** <https://discuss.elastic.co/t/truncating-multi-line/121425>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 26, 2018, 4:18am UTC](https://discuss.elastic.co/t/truncating-multi-line/121425 "2018-02-26T04:18:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yudha\_Herwono](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@Yudha\_Herwono](https://discuss.elastic.co/u/Yudha_Herwono)\
**Post date:** [February 26, 2018, 4:18am UTC](https://discuss.elastic.co/t/truncating-multi-line/121425/1 "2018-02-26T04:18:34Z")

</div>

Hi, I would like to know how to truncate log message.  
Below is the example:  
2018/02/22 00:26:36.233 | ERROR [TaskExecutor-master-11369-ProcessTask [8879082013622]] [ActionNode] Error executing  
2018/02/22 00:26:36.233 | java.lang.NullPointerException  
2018/02/22 00:26:36.233 | at XXX

If I use the multiline example I'm able to get the above 3 lines as one event, but the issue is that the content of the event is like the following:  
ERROR [TaskExecutor-master-11369-ProcessTask [8879082013622]] [ActionNode] Error executing  
2018/02/22 00:26:36.233 | java.lang.NullPointerException  
2018/02/22 00:26:36.233 | at XXX

How can I truncate the timestamp from the message, so that I can get the following:  
ERROR [TaskExecutor-master-11369-ProcessTask [8879082013622]] [ActionNode] Error executing  
java.lang.NullPointerException  
at XXX

Thank you.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [February 27, 2018, 3:38am UTC](https://discuss.elastic.co/t/truncating-multi-line/121425/2 "2018-02-27T03:38:51Z")

</div>

Filebeat is focused on log shipping. For log processing have a look at Logstash or the Ingest Pipeline in Elasticsearch. It seems you have a more complex case here so Logstash is probably the way to go.

---

<div class="post-metadata">

**Author:** ![Yudha\_Herwono](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@Yudha\_Herwono](https://discuss.elastic.co/u/Yudha_Herwono)\
**Post date:** [February 28, 2018, 5:47am UTC](https://discuss.elastic.co/t/truncating-multi-line/121425/3 "2018-02-28T05:47:41Z")

</div>

Thanks for the response. At least I know now, that filebeat is not the right place to accomplish the requirement.

---

<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:** [March 28, 2018, 5:47am UTC](https://discuss.elastic.co/t/truncating-multi-line/121425/4 "2018-03-28T05:47:45Z")

</div>

Closed on March 28, 2018, 5:47am UTC

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