# Parse two log files into Single index in ES via Logstash

**URL:** <https://discuss.elastic.co/t/parse-two-log-files-into-single-index-in-es-via-logstash/179077>\
**Category:** Logstash\
**Created:** [April 30, 2019, 11:37am UTC](https://discuss.elastic.co/t/parse-two-log-files-into-single-index-in-es-via-logstash/179077 "2019-04-30T11:37:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjabiulla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sjabiulla/32/48429_2.png) [@sjabiulla](https://discuss.elastic.co/u/sjabiulla)\
**Post date:** [April 30, 2019, 11:37am UTC](https://discuss.elastic.co/t/parse-two-log-files-into-single-index-in-es-via-logstash/179077/1 "2019-04-30T11:37:28Z")

</div>

Hi,

I have two log files and I want to merge the data from two log files and index the data into the same document.

Log file 1 format:  
\<JOB\_NAME\> \<APPLICATION\_NAME\> \<STARTED\_TIME\> \<CURRENT\_STATUS\>

Log file 2 format:  
\<JOB\_NAME\> \<AVERAGE\_TIME\_TAKEN\>

Currently I'm able to parse the above two log files using two seperate GROK match patterns. But I want to index these two log files in to single index as below.

```
      {
        "_index" : "my-index",
        "_type" : "doc",
        "_id" : "va_TbWoBfjxVI6P8WKhc",
        "_score" : 1.0,
        "_source" : {
          "@timestamp" : "2019-04-30T10:38:46.065Z",
          "status" : "Completed",
          "@version" : "1",
          "job_name" : "my-job-2",
          "application_name" : "my-app-name",
          "avg_time_taken" : 500
        }

```

Is this possible via Logstash ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 30, 2019, 2:24pm UTC](https://discuss.elastic.co/t/parse-two-log-files-into-single-index-in-es-via-logstash/179077/2 "2019-04-30T14:24:10Z")

</div>

Take a look at [this](https://discuss.elastic.co/t/aggregate-problem/142572/7).

---

<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:** [May 28, 2019, 2:24pm UTC](https://discuss.elastic.co/t/parse-two-log-files-into-single-index-in-es-via-logstash/179077/3 "2019-05-28T14:24:19Z")

</div>

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