# How to handle dot in field names in ES 7.0

**URL:** https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511
**Category:** Elasticsearch
**Created:** [April 11, 2019, 11:17pm UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511 "2019-04-11T23:17:01Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![shanky1997](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shanky1997](https://discuss.elastic.co/u/shanky1997)
#### Post date: [April 11, 2019, 11:17pm UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/1 "2019-04-11T23:17:01Z")

</div>

I was recently hit by the fieldname-with-dots issue in ES. I search on google but found the answer for ES 2.X version while for other version none of the option work for me.

execution.command = /bin/bash  
execution.command.args = emrStatusCluster

**"Note : type\_name is deprecated for ES 7.0 so default type is \_doc "**

I use **curl -XPOST localhost:9200/index\_name/\_doc -H "Content-Type: application/json" -d @jsondata.json** to load data and get following mssg on the console.

{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Can't merge a non object mapping [execution.command] with an object mapping [execution.command]"}],"type":"illegal\_argument\_exception","reason":"Can't merge a non object mapping [execution.command] with an object mapping [execution.command]"},"status":400

I tried dot\_expander but didnot find anything much useful and constructive.

Thanks in Advance ,  
Shanky

---

<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 12, 2019, 12:38am UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/2 "2019-04-12T00:38:38Z")

</div>

What do you have in **jsondata.json**?

---

<div class="post-metadata">

### Author: ![shanky1997](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shanky1997](https://discuss.elastic.co/u/shanky1997)
#### Post date: [April 12, 2019, 3:05am UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/3 "2019-04-12T03:05:37Z")

</div>

A single Json record in which execution.command and execution.command.argrs are present somewhere as key.

---

<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 12, 2019, 4:49am UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/4 "2019-04-12T04:49:19Z")

</div>

You need to fix its content probably.

---

<div class="post-metadata">

### Author: ![shanky1997](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shanky1997](https://discuss.elastic.co/u/shanky1997)
#### Post date: [April 17, 2019, 11:32am UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/5 "2019-04-17T11:32:18Z")

</div>

I don't have any control on content since content comes from nifi where i call elastic search api is there any way to deal as it is given for ES 2.X version where we can allow dot in field name.

Thanks in advance.

---

<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 17, 2019, 12:19pm UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/6 "2019-04-17T12:19:49Z")

</div>

I don't really know as I can't see the content.

---

<div class="post-metadata">

### Author: ![shanky1997](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shanky1997](https://discuss.elastic.co/u/shanky1997)
#### Post date: [April 18, 2019, 5:43am UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/7 "2019-04-18T05:43:43Z")

</div>

Ok let me give you small view of Content which is in json format:

```
{  
   "s3.version":"mc5ETuM",
   "invokehttp.tx.id":"f75283d92c",
   "sqs.receipt.handle":"Zl/yWciVceGIiWiC5sNkQ=",
   "Server":"J4)",
   "s3.etag":"712a41",
   "listEMResponse":"",
   "indexed_file_path":"fasfd",
   "schemaName":"",
   "uuid":"cf",
   "sqs.message.id":"ae",
   "sqs.SenderId":"AI",
   "hash.value":"7b77",
   "tableName":"Table1",
   "execution.command":"/bin/bash",
   "filename":"1554448956907.csv",
   "s3.key":"/15544_TB_.csv",
   "execution.command.args":".-1"
}

```

Now the problem is execution.command.args and execution.command both contain data if i make execution.command type as object then on running it will give error what i did is :

```
PUT index_try
{
  "mappings": {
    "json": {
      "properties": {
        "created_at": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
        },
        "execution": {
          "type": "object",
          "properties": {
            "command": {
              "type": "object",
              "properties": {
                "args": {
                  "type": "text"
                }
              }
            }
          }
        }
      }
    }
  },
  "settings": {
    "number_of_shards": 6,
    "number_of_replicas": 1
  }
}

```

I refered following post may be this help you 🙂

> <https://github.com/elastic/elasticsearch/issues/15951>

---

<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 23, 2019, 7:40am UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/8 "2019-04-23T07:40:12Z")

</div>

One of the problem you have is:

- `"execution.command":"/bin/bash",`
- `"execution.command.args":".-1"`

Here you try to say that `execution.command` is a `text`. And `execution.command.args` is the `args` field inside `execution.command` `object`. Which would mean that `execution.command` should be both an `object` and a `text` field. Which is not possible.

You should rewrite your document field names in a way they are not seen as objects. Like:

```auto
{  
   "execution_command":"/bin/bash",
   "execution_command_args":".-1"
}

```

---

<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 21, 2019, 7:40am UTC](https://discuss.elastic.co/t/how-to-handle-dot-in-field-names-in-es-7-0/176511/9 "2019-05-21T07:40:16Z")

</div>

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