Splitting elasticsearch data per node

I have some metrics in Elasticsearch from Metricbeat that I’d like to display in Grafana. my query is this:

“service.name: elasticsearch and metricset.name: node_stats”

and I’m using a SUM metric on elasticsearch.node.stats.jvm.mem.pools.young.used.bytes

This returns the used bytes for all my ES hosts but I’d like to split this up per host. Unfortunately i can’t just add filters as ES is running in Docker containers and the hostname can change at any time.

Is there a way to split the data on the elasticsearch.node.name field?

I figured this out, by grouping twice. First by the term elasticsearch.node.name.keyword and then by date histogram