Aggregations in logstash

Hi all,
How can we use aggregations in logstash .conf file.My input is a csv file from 2 different sources.I need to group by a field and perform aggregations like sum,average,etc.
1st csv file has fields:
date,amt,type
2nd csv file has fields:
date,count,type
So I need to get output like:
date,type,(tot_amt/tot_count)

The only way I can think of would be to index each file separately, then query the data from ES and then reindex it.

There's currently no way to do this in LS I can think of. Someone else might have something though.

I am new to elasticsearch.Can you expain where to query data in elasticsearch which you mentioned above.

To compute sum, avg, etc, you could use metrics filter