# How to parse first line in all the next lines

**URL:** <https://discuss.elastic.co/t/how-to-parse-first-line-in-all-the-next-lines/260459>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 7, 2021, 3:49pm UTC](https://discuss.elastic.co/t/how-to-parse-first-line-in-all-the-next-lines/260459 "2021-01-07T15:49:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin\_urbina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_urbina/32/80705_2.png) [@kevin\_urbina](https://discuss.elastic.co/u/kevin_urbina)\
**Post date:** [January 7, 2021, 3:49pm UTC](https://discuss.elastic.co/t/how-to-parse-first-line-in-all-the-next-lines/260459/1 "2021-01-07T15:49:23Z")

</div>

Hello everyone,

I am having the following log :

Sun Dec 20 00:40:05 CST 2020: Starting docker, stream=prod, version=latest, pwd=PATH  
Processing...  
SERVER oc: Successfully processed 23 TSM servers. Failed: 23  
Details:  
1 (Host1): HTTP POST request failed, rc=500, null, msg=Internal Server Error  
2 (Host2): TSM Server registration not found for hostname Host2  
3 (Host3): HTTP POST request failed, rc=500, null, msg=Internal Server Error  
4 (Host4): Index: 0, Size: 0  
5 (Host5): TSM Server registration not found for hostname Host5  
6 (Host6): HTTP POST request failed, rc=500, null, msg=Internal Server Error  
7 (Host7): TSM Server registration not found for hostname Host7

Processing completed, elapsed time=896.59 seconds  
Sun Dec 20 00:55:05 CST 2020: Finished, rc=0

I need that somehow filebeats read just the events that start with a number but adds the first line of date to each one of them, for example:

Sun Dec 20 00:40:05 CST 2020: Starting docker, stream=prod, version=latest, pwd=PATH 1 (Host1): HTTP POST request failed, rc=500, null, msg=Internal Server Error

Sun Dec 20 00:40:05 CST 2020: Starting docker, stream=prod, version=latest, pwd=PATH 2 (Host2): TSM Server registration not found for hostname Host2

This since I need to extract every host event but with a date associated to it.

Can you Help me please?

Thank you

Regards

Kevin Scott Urbina Moreira

---

<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:** [February 4, 2021, 5:49pm UTC](https://discuss.elastic.co/t/how-to-parse-first-line-in-all-the-next-lines/260459/2 "2021-02-04T17:49:26Z")

</div>

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