Ho to aggregate multi lines in one

store type
1 1
1 2
2 1
2 3

group by type, output
1 1,2
2 1
3 2

how to use a filter do this in logstash.
please help!