# Struggling to get basic roleups working

**URL:** <https://discuss.elastic.co/t/struggling-to-get-basic-roleups-working/211935>\
**Category:** Elasticsearch\
**Created:** [December 16, 2019, 1:45am UTC](https://discuss.elastic.co/t/struggling-to-get-basic-roleups-working/211935 "2019-12-16T01:45:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alecrooney](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@alecrooney](https://discuss.elastic.co/u/alecrooney)\
**Post date:** [December 16, 2019, 1:45am UTC](https://discuss.elastic.co/t/struggling-to-get-basic-roleups-working/211935/1 "2019-12-16T01:45:43Z")

</div>

Trying to use rollups. Here is my role up definition:

```
{
  "config": {
    "id": "connections_rollup_test_1",
    "index_pattern": "connections_c1_*",
    "rollup_index": "connections_rollup_test_1",
    "cron": "0 * * * * ?",
    "groups": {
      "date_histogram": {
        "fixed_interval": "5m",
        "field": "created_at",
        "delay": "30s",
        "time_zone": "UTC"
      },
      "terms": {
        "fields": [
          "device_key"
        ]
      }
    },
    "metrics": [
      {
        "field": "bandwidth",
        "metrics": [
          "sum"
        ]
      }
    ],
    "timeout": "20s",
    "page_size": 1000
  },
  "status": {
    "job_state": "indexing",
    "current_position": {
      "created_at.date_histogram": 1574817600000,
      "device_key.terms": "123b0300-dc3d-4c6b-a174-b7f9228644e1"
    },
    "upgraded_doc_id": true
  },
  "stats": {
    "pages_processed": 257,
    "documents_processed": 13203322,
    "rollups_indexed": 257000,
    "trigger_count": 1,
    "index_time_in_ms": 422335,
    "index_total": 257,
    "index_failures": 0,
    "search_time_in_ms": 75850,
    "search_total": 257,
    "search_failures": 0
  }
}

```

In the logs I see the following:

```
2019-12-16T01:31:57,154][DEBUG][o.e.a.b.TransportShardBulkAction] [es-1] [connections_rollup_test_1][0] failed to execute bulk item (index) index {[connections_rollup_test_1][_doc][connections_rollup_test_1$6l734zrgjXQcgc0UlENsEw], source[{"bandwidth.sum.value":108.0,"created_at.date_histogram.time_zone":"UTC","created_at.date_histogram.timestamp":1574719800000,"created_at.date_histogram._count":2,"_rollup.version":2,"created_at.date_histogram.interval":"5m","device_key.terms._count":2,"device_key.terms.value":"09858ffe-fc30-448a-a87c-9418854b7787","_rollup.id":"connections_rollup_test_1"}]}

org.elasticsearch.index.mapper.MapperParsingException: Could not dynamically add mapping for field [bandwidth.sum.value]. Existing mapping for [bandwidth] must be of type object but found [long].

```

I don't understand how I am supposed to turn bandwidth which is a numeric metric that I am summing over into an object? Or why that mapping is having a conflict in the first place. Bandwidth is a long in the underlying index mapping. Any help would be greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [December 16, 2019, 1:57am UTC](https://discuss.elastic.co/t/struggling-to-get-basic-roleups-working/211935/2 "2019-12-16T01:57:46Z")

</div>

Do you have a template with index pattern matching the rollup index "connections\_rollup\_test\_"? if you do, does it define mapping for the "bandwidth" field? I think that could cause your conflict.

If so, try with an index name that won't match the template.

---

<div class="post-metadata">

**Author:** ![alecrooney](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@alecrooney](https://discuss.elastic.co/u/alecrooney)\
**Post date:** [December 21, 2019, 2:59pm UTC](https://discuss.elastic.co/t/struggling-to-get-basic-roleups-working/211935/3 "2019-12-21T14:59:11Z")

</div>

That was it! I had a template that matched the pattern of the rollup name. Thanks so much for the suggestion. Was completely stumped as to what it was.

---

<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:** [January 18, 2020, 3:02pm UTC](https://discuss.elastic.co/t/struggling-to-get-basic-roleups-working/211935/4 "2020-01-18T15:02:25Z")

</div>

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