# Frequency of a field with python elasticsearch module

**URL:** <https://discuss.elastic.co/t/frequency-of-a-field-with-python-elasticsearch-module/284644>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 20, 2021, 5:36pm UTC](https://discuss.elastic.co/t/frequency-of-a-field-with-python-elasticsearch-module/284644 "2021-09-20T17:36:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mortenb123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mortenb123/32/37227_2.png) [@mortenb123](https://discuss.elastic.co/u/mortenb123)\
**Post date:** [September 20, 2021, 5:36pm UTC](https://discuss.elastic.co/t/frequency-of-a-field-with-python-elasticsearch-module/284644/1 "2021-09-20T17:36:35Z")

</div>

I need to count the frequency of a field, how can I do this?, I tried with aggs, but the module only says:

```auto
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.RequestError: RequestError(400, 'parsing_exception', 'request does not support [aggs]')

```

I can count, I can search, but the 10K limit on search is way too little for a period:

I tried the following:

```auto
20210920192914.192|DEBUG|C:\dist\work\trk-fullstack-test\bin\elkq.py:265|body: {
  "_source": {
    "includes": [
      "kubernetes.container.name"
    ]
  },
  "aggs": {
    "kubernetes.container.name": {
      "test-agg-00": {
        "value_count": {
          "field": "kubernetes.container.name"
        }
      }
    }
  },
  "from": 0,
  "query": {
    "bool": {
      "filter": [
        {
          "range": {
            "@timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2021-09-19T17:29:14.189Z",
              "lte": "2021-09-20T17:29:14.190Z"
            }
          }
        }
      ]
    }
  },
  "size": 10,
  "sort": [
    {
      "@timestamp": {
        "order": "desc",
        "unmapped_type": "boolean"
      }
    }
  ]
}

```

I see the aggs examples are rest directly, so I can test using requests directly

---

<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:** [October 18, 2021, 5:37pm UTC](https://discuss.elastic.co/t/frequency-of-a-field-with-python-elasticsearch-module/284644/2 "2021-10-18T17:37:25Z")

</div>

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