Push logstash aggregate map as fields in final event

Yes, you could do

    aggregate {
        task_id => "%{task}"
        map_action => "update"
        end_of_task => true
        code => 'map.each { |k, v| event.set(k, v) }'
    }

You might also be able to do it using the push_previous_map_as_event option, but that would depend on your data.