# Parse multiple lines of Log file into the same Elasticsearch document based on ID

**URL:** <https://discuss.elastic.co/t/parse-multiple-lines-of-log-file-into-the-same-elasticsearch-document-based-on-id/131145>\
**Category:** Logstash\
**Created:** [May 9, 2018, 9:31am UTC](https://discuss.elastic.co/t/parse-multiple-lines-of-log-file-into-the-same-elasticsearch-document-based-on-id/131145 "2018-05-09T09:31:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bacem.hagui](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@bacem.hagui](https://discuss.elastic.co/u/bacem.hagui)\
**Post date:** [May 9, 2018, 9:31am UTC](https://discuss.elastic.co/t/parse-multiple-lines-of-log-file-into-the-same-elasticsearch-document-based-on-id/131145/1 "2018-05-09T09:31:34Z")

</div>

I would like to store the times for different tasks of a job. The log file of my job has several lines each of which is a different task. Here is an example:

`2018-04-25 18:33:40.940 INFO be8f587e-aae3-4e56-88a2-75dde556a99c --- Task 1`  
`2018-04-25 18:33:43.941 INFO be8f587e-aae3-4e56-88a2-75dde556a99c --- Task 2`  
`2018-04-25 18:33:46.775 INFO be8f587e-aae3-4e56-88a2-75dde556a99c --- Task 3`

As you can see, the three tasks have the same job ID which can be used as the unique ID for an Elasticsearch document. I would liked to have 3 fields in this elasticsearch document named task 1, task 2 and task 3 containing the respective times.

Any help intoducing tools or plugins that will help me will be greatly appreciated, especially with an example of code or a demonstration. Thanks in advance!

---

<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 6, 2018, 9:31am UTC](https://discuss.elastic.co/t/parse-multiple-lines-of-log-file-into-the-same-elasticsearch-document-based-on-id/131145/2 "2018-06-06T09:31:49Z")

</div>

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