# Create a custom ECS settings via github repo

**URL:** <https://discuss.elastic.co/t/create-a-custom-ecs-settings-via-github-repo/280769>\
**Category:** Elasticsearch\
**Tags:** ecs-elastic-common-schema\
**Created:** [August 9, 2021, 7:58am UTC](https://discuss.elastic.co/t/create-a-custom-ecs-settings-via-github-repo/280769 "2021-08-09T07:58:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas74](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thomas74](https://discuss.elastic.co/u/Thomas74)\
**Post date:** [August 9, 2021, 7:58am UTC](https://discuss.elastic.co/t/create-a-custom-ecs-settings-via-github-repo/280769/1 "2021-08-09T07:58:32Z")

</div>

Hi,

I'm trying to generate ecs template with custom settings. For that, I used this repo [GitHub - elastic/ecs: Elastic Common Schema](https://github.com/elastic/ecs).

Command used :  
`python scripts/generator.py --template-settings template.json --ref v1.7.0 --out ./test`

Setting template used :

```auto
{
  "index_patterns": ["fluentd_openshift-sbx-*"],
  "order": 1,
  "settings": {
    "index": {
      "lifecycle": {
        "name": "openshift",
        "rollover_alias": "fluentd_openshift-sbx"
      },
      "number_of_shards": "1",
      "number_of_replicas": "1",
      "mapping": {
        "total_fields": {
          "limit": 1000
        }
      }
    }
  }
}

```

Problem is that this template generated cannot be sent to elasticsearch :

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "x_content_parse_exception",
        "reason" : "[1:58] [index_template] unknown field [mappings]"
      }
    ],
    "type" : "x_content_parse_exception",
    "reason" : "[1:58] [index_template] unknown field [mappings]"
  },
  "status" : 400
}

```

Why I can't push this generated template ? Did I missed something ?

Best regards,

Thomas

---

<div class="post-metadata">

**Author:** ![ebeahan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebeahan/32/78989_2.png) [@ebeahan](https://discuss.elastic.co/u/ebeahan)\
**Post date:** [August 13, 2021, 3:11pm UTC](https://discuss.elastic.co/t/create-a-custom-ecs-settings-via-github-repo/280769/2 "2021-08-13T15:11:29Z")

</div>

Hi, @Thomas74!

I've seen that error when submitting a legacy index template to the `_index_template` API instead of the `_template` legacy index template API.

Which API are you using when you see the error? And which generated ES artifact are you trying to install?

---

<div class="post-metadata">

**Author:** ![Thomas74](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thomas74](https://discuss.elastic.co/u/Thomas74)\
**Post date:** [August 18, 2021, 7:41am UTC](https://discuss.elastic.co/t/create-a-custom-ecs-settings-via-github-repo/280769/3 "2021-08-18T07:41:41Z")

</div>

Hello @ebeahan

It seems that I was wrong when submitting my index template...

I think you are right, I used bad legacy index API. With`_template` API it works.

```auto
curl -X POST "https://elastic.lan:9200/_template/test-ecs" -u user:xxx -H 'Content-Type: application/json' -k -d @template.json

```

I didn't select specifics artifacts for now. I tried with a minimum specific config to know if I was in a good way of working 🙂

Thanks for your answer !

---

<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:** [September 15, 2021, 7:42am UTC](https://discuss.elastic.co/t/create-a-custom-ecs-settings-via-github-repo/280769/4 "2021-09-15T07:42:40Z")

</div>

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