Query DSL in kibana discover

I want to run this below query in kibana discover filter

 "aggs": {
    "response_term": {
      "terms": {
        "field": "ResponseCode.keyword",
        "size": 100000
   "response": {
     "cardinality": {
       "field": "ResponseCode.keyword"
     "bucket_selector": {
       "buckets_path": {
         "max_10": "response"
       "script": "params.max_10 > 10"

But i am getting unknown field [aggs]

Can anyone tell me why it is not running kibana discover but running in devtools

As far as I know you can't run aggregation in Discover filter. It's just a filter It does not support aggregations as the error message says

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