Fetch common key values from 2 aggregation results

19 Views Asked by At

I have aggregation output having two datasets, need to find the key values present in both.

 {  "aggregations":{   "data4hr":{
      doc_count:12345,
      "NAME":{
         "doc_count_error_upper_bound":0,
         "sum_other_doc_count":0,
         "buckets":[
          {
            "key": "id1",
            "doc_count": 50
          },
          {
            "key": "id9",
            "doc_count": 60
          },
          .
          .]
         }
       },    "data2hr":{
      doc_count:19845,
      "NAME":{
         "doc_count_error_upper_bound":0,
         "sum_other_doc_count":0,
         "buckets":[
          {
            "key": "id19",
            "doc_count": 50
          },
          {
            "key": "id129",
            "doc_count": 60
          },
          .
          .]
         }
       }   } }

How to fetch the common keys from aggregation result set Data4hr and Data2hr

0

There are 0 best solutions below