Is it possible to aggregate nested objects within a nested object?

Hi,

I am pulling data from an oracle database using jdbc connection and then loading that into ES via logstash. Using the aggregate filter function I am successfully able to nest columns based on a task_id and using a map for the nested object.

My question, is it possible to then further map a nested object below this nested object? I am struggling to work out what the syntax might look like.

My current filter is below so for each course_id there could be 1 or more opportunity_id this is working fine. I then need to add further child object for each opportunity_id is this possible using the aggregate filter?

filter {
aggregate {
task_id => "%{course_id}"
code => "
map ['institution_id'] = event.get('institution_id')
map ['course_id'] = event.get('course_id')
map ['opportunity_detail'] ||=
map ['opportunity_detail'] << { 'opportunity_id' => event.get('opportunity_id'), 'local_per_year_fees' => event.get('local_per_year_fees'),'length_of_study_months' => event.get('length_of_study_months'),'int_study_mode_id' => event.get('int_study_mode_id'),'venue_id' => event.get('venue_id')}
map ['search_detail'] ||=
map ['search_detail'] << { 'er_qual_grade_id' => event.get('er_qual_grade_id'), 'er_qual_id' => event.get('er_qual_id'),'grade_value' => event.get('grade_value'),'group_id' => event.get('group_id'),'hierarchy_order' => event.get('hierarchy_order')}
"
timeout_tags => ["aggregate"]
push_previous_map_as_event => true
timeout => 5
}
}