Several selects in one query

Thank you for your answer. I used the aggregate filter in the logstash configuration file to extract the values, that way I didn't need the subqueries.