# Join two log files using aggregate filter of logstash

**URL:** https://discuss.elastic.co/t/join-two-log-files-using-aggregate-filter-of-logstash/236468
**Category:** Logstash
**Created:** [June 10, 2020, 9:06am UTC](https://discuss.elastic.co/t/join-two-log-files-using-aggregate-filter-of-logstash/236468 "2020-06-10T09:06:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Rushabh\_Doshi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rushabh_doshi/32/69886_2.png) [@Rushabh\_Doshi](https://discuss.elastic.co/u/Rushabh_Doshi)
#### Post date: [June 10, 2020, 9:06am UTC](https://discuss.elastic.co/t/join-two-log-files-using-aggregate-filter-of-logstash/236468/1 "2020-06-10T09:06:09Z")

</div>

I have used the below aggregate plugin for logstash to join two log files: Log1: PAGE,PAGEDESCRIPTION

Log 2: PAGE,HTTPAGENT

I WANT THE FINAL OUTPUT in kibana as: PAGE,PAGEDESCRIPTION,HTTPAGENT. The aggregate plugin snippet i used in filter

````auto
 task_id => "%{PAGE}"
       code => "
         map['PAGE'] ||= event.get('PAGE')
         map['PAGEDESCRIPTION'] ||= event.get('PAGEDESCRIPTION')
         map['HTTPAGENT'] ||= event.get('HTTPAGENT')
         #event.cancel()
       "
       push_previous_map_as_event => true
       timeout => 3

     }```

But aggregate is not pushing the event to kibana , output in logstash conf file is as below:

output{

    elasticsearch {
        hosts => ["10.0.62.184:9200"]
        index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"

        #document_id => "%{PAGE}"
        template_overwrite => true
    }
}

May i know what mistake i am doing or am i missing anything here

````

---

<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 8, 2020, 9:06am UTC](https://discuss.elastic.co/t/join-two-log-files-using-aggregate-filter-of-logstash/236468/2 "2020-07-08T09:06:19Z")

</div>

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