# Unexpected token \[':'\] was expecting one of \[{\<EOF\>, ';'}\]

**URL:** <https://discuss.elastic.co/t/unexpected-token-was-expecting-one-of-eof/207298>\
**Category:** Elasticsearch\
**Created:** [November 11, 2019, 8:17am UTC](https://discuss.elastic.co/t/unexpected-token-was-expecting-one-of-eof/207298 "2019-11-11T08:17:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Java\_Developet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/java_developet/32/56310_2.png) [@Java\_Developet](https://discuss.elastic.co/u/Java_Developet)\
**Post date:** [November 11, 2019, 8:17am UTC](https://discuss.elastic.co/t/unexpected-token-was-expecting-one-of-eof/207298/1 "2019-11-11T08:17:01Z")

</div>

Hello, in my mappings I have a field with the character ':' in it, specifically

```
  "meta_og:type" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 256
      }
    }
  },

```

I want to add a value to this field in a document with the curl

```
curl -X POST "localhost:9200/nutchindex2/doc/27130d1a085cf91f0ac9bf7c3a75797a/_update?pretty" -H 'Content-Type: application/json' -d'                                                      
{
    "script" : "ctx._source.meta_og:type = \"article\""
}
'

```

But I get the following error

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "remote_transport_exception",
        "reason" : "[WgJFBhd][10.164.0.4:9300][indices:data/write/update[s]]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "failed to execute script",
    "caused_by" : {
      "type" : "script_exception",
      "reason" : "compile error",
      "script_stack" : [
        "ctx._source.meta_og:type = \"article\"",
        " ^---- HERE"
      ],
      "script" : "ctx._source.meta_og:type = \"article\"",
      "lang" : "painless",
      "caused_by" : {
        "type" : "illegal_argument_exception",
        "reason" : "unexpected token [':'] was expecting one of [{<EOF>, ';'}]."
      }
    }
  },
  "status" : 400
}

```

If I do the exact same append, but to the field "type" instead of "meta\_of:type", it works perfectly. (i have the field "type" mapped aswell).

So is there a way to break the "illeagal" character, or something like that. I tried using

> og\_meta\:type

,but that didnt work either.

EDIT: I am using Elastic 5.4

---

<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:** [December 9, 2019, 8:17am UTC](https://discuss.elastic.co/t/unexpected-token-was-expecting-one-of-eof/207298/2 "2019-12-09T08:17:05Z")

</div>

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