# Value and doc\_count difference

**URL:** <https://discuss.elastic.co/t/value-and-doc-count-difference/174738>\
**Category:** Elasticsearch\
**Created:** [April 1, 2019, 8:39am UTC](https://discuss.elastic.co/t/value-and-doc-count-difference/174738 "2019-04-01T08:39:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![victor3443](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@victor3443](https://discuss.elastic.co/u/victor3443)\
**Post date:** [April 1, 2019, 8:39am UTC](https://discuss.elastic.co/t/value-and-doc-count-difference/174738/1 "2019-04-01T08:39:11Z")

</div>

Hello,

I am having a hard time trying to understand the value and doc\_count parameters when performing a query. As you see, in the result query I get two different numbers per "key" : "Access from malicious IP address", same for "key":"6". I don't understand why and would like clarification on the matter. Thank you.

```
  "aggregations" : {
    "2" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [
        {
          "key" : "6",
          "doc_count" : 283,
          "1" : {
            "value" : 154
          },
          "3" : {
            "doc_count_error_upper_bound" : 0,
            "sum_other_doc_count" : 0,
            "buckets" : [
              {
                "key" : "malicious IP address",
                "doc_count" : 277,
                "1" : {
                  "value" : 148
                }
              },
              {
                "key" : "Evasion technique detected",
                "doc_count" : 6,
                "1" : {
                  "value" : 6
                }
              }
            ]
          }
        }
      ]
    }
  }
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 29, 2019, 8:39am UTC](https://discuss.elastic.co/t/value-and-doc-count-difference/174738/2 "2019-04-29T08:39:17Z")

</div>

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