# Dynamic field mapping under an object field

**URL:** <https://discuss.elastic.co/t/dynamic-field-mapping-under-an-object-field/89947>\
**Category:** Elasticsearch\
**Created:** [June 19, 2017, 2:14pm UTC](https://discuss.elastic.co/t/dynamic-field-mapping-under-an-object-field/89947 "2017-06-19T14:14:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lefagr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lefagr/32/18830_2.png) [@lefagr](https://discuss.elastic.co/u/lefagr)\
**Post date:** [June 19, 2017, 2:14pm UTC](https://discuss.elastic.co/t/dynamic-field-mapping-under-an-object-field/89947/1 "2017-06-19T14:14:34Z")

</div>

Hello,  
I run elasticsearch 5.4.1.

I want to create a dynamic template for filebeat with numeric detection enabled. I want though to force keyword type for all fields under an object (dynamically generated with kv logstash filter):

```
_template/filebeat
{
    "order": 0,
    "template": "filebeat-*",
    "settings": {
      "index": {
        "mapping": {
          "total_fields": {
            "limit": "10000"
          }
        },
        "refresh_interval": "5s",
        "number_of_shards": "1",
        "number_of_replicas": "2"
      }
    },
    "mappings": {
      "_default_": {
        "numeric_detection": true,
        "_meta": {
          "version": "5.4.1"
        },
        "dynamic_templates": [
          {
            "strings_as_keyword": {
              "mapping": {
                "ignore_above": 1024,
                "type": "keyword"
              },
              "match_mapping_type": "string"
            }
          }
        ],
        "_all": {
          "norms": false
        },
        "date_detection": true,
        "properties": {
          "apache2": {
            "properties": {
              "access": {
                "properties": {
                  "request_param": {
                    "properties": {
                         "_all": {
                    "ignore_above": 1024,
                    "type": "keyword"
                  }
            }
   } 
.
.
.
}

```

Is something like this possible ? If not is there any other ways to achieve the above case ?

---

<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:** [July 17, 2017, 2:14pm UTC](https://discuss.elastic.co/t/dynamic-field-mapping-under-an-object-field/89947/2 "2017-07-17T14:14:51Z")

</div>

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