About ERROR: Invalid pipeline aggregation

How can I fix this? It is a simple cross-value between aggregations, but due to only sibling pipeline aggregations are not allowed, I have no other idea how to fix it. Anyone, please...

"aggs": {
"sensor_1": {
"filter": {
"term": {
"uuid.sensorId": 1
}
},
"aggs": {
"dates_sensor_1": {
"date_histogram": {
"field": "measure.timestamp",
"interval": "day",
}
}
}
},
"sensor_2": {
"filter": {
"term": {
"uuid.sensorId": 3
}
}
},
"filter_of_aggs_sensor_2": {
"bucket_selector": {
"buckets_path": {
"filtered_ bucket": "sensor_2"
},
"script": "filtered_bucket = dates_sensor_1"
}
}
}
}