How to Use aggs in kibana 4 for Metrics Visualization

I have created sense query that's work fine for me but I want it to apply in Metrics Visualization.
query I wrote is :

{
"query": {
  "bool": {
    "must": {
      "match": {"stats.key":"node.disk.type.*"
        
      }
    },
    "must_not": [
      {
        "match": {
          "stats.string": "unknown"
        }
      },
      {
        "match": {
          "stats.string": "ssd"
        }
      },
      {
        "match": {
          "stats.string": "null"
        }
      }
    ]
  }
},"aggs": { 
"cardinality": {
      "field": "stats.key",
        "field": "events.specifiers.lnn"
    }
     }
   }
 }

Now from this the query part will be written in search bar but what about "aggs" part.

For the most part, you can add the filter part of the Elasticsearch query DSL to the search bar of Kibana (see example here). You can also add advanced logic to pinned filters by editing them (see here).