Custom query to create data table

Hi

I do have the following custom query and want to create a Data Table visualization from it:

GET applications_*/_search
{ "size" : "0",
  "aggregations": {
    "by_size": {
      "terms": {
        "field": "Size"
      },
      "aggregations": {
        "distinct_appl": 
                               {
            "cardinality": { "field" : "applname.keyword" }
        },
        "without_a_server_name" : 
         {
            "missing" : { "field" : "server_name" }
         },
         "unique_server_name" : 
         {
            "cardinality" : { "field" : "server_name" }
         }
      }
    }
  }
}

The output should be :
Size, #distinct_apps, #without_a_server_name,#unique_server_name

How can I get this visualized?

Regards Hans

You can achieve the cardinality aggregations by creating "Unique Count" Metrics for those fields in the Data Table visualization.

As far as I can tell, there is not an easy way to add an output showing counts from missing fields in the same visualization. One way to do this is create a copy of the visualization and apply a filter where "server_name" does not exist.

Ok
I'll try.
Thanks

I managed to do it with Visual Builder.
With Options you can supply a filter per aggregation.

1 Like

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