How to use ES's cardinality on templating

Hi
I want get unique count form ES as templating variable, How to integrate the following syntax

Thanks
{
“size” : 0,
“aggs” : {
“aa” : {
“cardinality”: {
“field”: “_index”
}
}
}
}

Hi,

I don’t think you can use aggregation with cardinality for template variables. Please have a look at the documentation of what kind of template queries that are supported.

Marcus