Ms teams watcher

"aggs": {
"cluster_wise": {
"terms": {
"field": "fields.cluster"
},
"aggs": {
"namespace_wise": {
"terms": {
"field": "kubernetes.namespace"
},
"aggs": {
"pod_wise": {
"terms": {
"field": "kubernetes.pod.name"
},
"aggs": {
"total_in_bytes": {
"max": {
"field": "jvm.memory.heap.max"
}
},
"used_in_bytes": {
"min": {
"field": "jvm.memory.heap.used"
}
},
"consumed_heap_ratio": {
"bucket_script": {
"buckets_path": {
"used_in_bytes": "used_in_bytes",
"total_in_bytes": "total_in_bytes"
},
"script": "params.used_in_bytes / params.total_in_bytes"
}
}
}
}
}
}
}
}
}

It's not clear what you are asking here, as posting code doesn't really help us understand your intentions or problems.