Metric visualization for Cardinality aggregation on multiple fields

Hi team,

I want to output the "value":"37" of the query result inside the "Metric" Kibana visualization.

Query-

POST index-a/_search?size=0
{
"aggs" : {
"1" : {
"cardinality" : {
"script" : {
"source" : "doc['Service.keyword'].value + '#' + doc['host.name.keyword'].value"
}
}
}
}
}

The output is -

{
"took" : 1626,
"timed_out" : false,
"_shards" : {
"total" : 6,
"successful" : 6,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 1821103,
"max_score" : 0.0,
"hits" :
},
"aggregations" : {
"1" : {
"value" : 37
}
}
}

Is there anyway I could do it in any Kibana visual if not in Metric?

Thanks,
Darshan

The most supported way is to edit your Kibana index pattern and create a scripted field, which can then be used in most visualizations in Kibana.

This serves my purpose.Thanks @wylie !

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.