# Unknown key for a START\_OBJECT in \[runtime\_mappings\]

**URL:** <https://discuss.elastic.co/t/unknown-key-for-a-start-object-in-runtime-mappings/270317>\
**Category:** Elasticsearch\
**Created:** [April 16, 2021, 1:29am UTC](https://discuss.elastic.co/t/unknown-key-for-a-start-object-in-runtime-mappings/270317 "2021-04-16T01:29:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![plm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/plm/32/77829_2.png) [@plm](https://discuss.elastic.co/u/plm)\
**Post date:** [April 16, 2021, 1:29am UTC](https://discuss.elastic.co/t/unknown-key-for-a-start-object-in-runtime-mappings/270317/1 "2021-04-16T01:29:35Z")

</div>

Hi,

I am getting the following error:

```auto
upload completely sent off: 426 out of 426 bytes
< HTTP/1.1 400 Bad Request
< content-type: application/json; charset=UTF-8
< content-length: 374
<
{
     “error” : {
          “root_cause” : [
               {
                   “type” : “parsing_exception”,
                    “reason” : “Unknown key for a START_OBJECT in [runtime_mappings].”,
                    “line” : 3,
                   “col” : 23
             }
          ],
     “type” : “parsing_exception”,
     “reason” : “Unknown key for a START_OBJECT in [runtime_mappings].”,
     “line” : 3,
     “col” : 23
},
“status” : 400
}

```

while executing the following query:

```auto
curl -u elastic:ghTn24vWH7qC577T00X6JJa1 -v -H “Content-Type: application/json” -XPOST http://localhost:9200/my)index/_search?pretty=true -d ’
{
     “runtime_mappings”: {
         “duration”: {
             “type”: “long”,
             “script”: {
                  “source”: “emit(doc[‘UpdateDate’].value.toInstant().toEpochMilli() - doc[‘creationDate’].value.toInstant().toEpochMilli())”
               }
         }
     },
     “aggs”: {
         “exec_time_outlier”: {
             “percentiles”: {
                   “field”: “duration”
               }
          }
     },
     “size”: 0
}’

```

I have been trying to find what I could be doing wrong, but the syntax looks exactly like the sample at the end of this documentation page:

> **[Define runtime fields in a search request | Elasticsearch Guide \[7.12\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime-search-request.html)**

I am using Elasticsearch 7.7.0

Any help appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 16, 2021, 4:56am UTC](https://discuss.elastic.co/t/unknown-key-for-a-start-object-in-runtime-mappings/270317/2 "2021-04-16T04:56:07Z")

</div>

The guide is for 7.12.0.

You need to upgrade as it's a new feature.

---

<div class="post-metadata">

**Author:** ![plm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/plm/32/77829_2.png) [@plm](https://discuss.elastic.co/u/plm)\
**Post date:** [April 16, 2021, 6:20pm UTC](https://discuss.elastic.co/t/unknown-key-for-a-start-object-in-runtime-mappings/270317/3 "2021-04-16T18:20:05Z")

</div>

Thanks for the quick response.

---

<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:** [May 14, 2021, 6:21pm UTC](https://discuss.elastic.co/t/unknown-key-for-a-start-object-in-runtime-mappings/270317/4 "2021-05-14T18:21:04Z")

</div>

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