Sharing index templates

I have set up Index Templates and Kibana objects that I think many people out there would like to copy.

Sharing Saved Objects as exported ndjson files is easy.

How can I share Index Templates configuration for other to easily import?

Index templates are containing name, index pattern, mappings, runtime fields and dynamic mapping.

Thank you very much for your support!

In Dev Tools GET _index_template/NAME and then copy the returned JSON to share.

{
  "index_templates" : [
    {
      "name" : "fidelis",
      "index_template" : {
        "index_patterns" : [
          "fidelis*"
        ],
        "template" : {
          "settings" : {
            "index" : {
              "number_of_shards" : "1",
              "mapping" : {
                "total_fields" : {
                  "limit" : "10000"
                }
              }
            }
          }
        },
        "composed_of" : [
          "fidelis",
          "meta",
          "ecs"
        ],
        "version" : 1
      }
    }
  ]
}

Then they would do a PUT _index_template/NAME with a body of the index_template that was returned in the GET.

PUT _index_template/fidelis
{
  "index_patterns": [
    "fidelis*"
  ],
  "template": {
    "settings": {
      "index": {
        "number_of_shards": "1",
        "mapping": {
          "total_fields": {
            "limit": "10000"
          }
        }
      }
    }
  },
  "composed_of": [
    "fidelis",
    "meta",
    "ecs"
  ],
  "version": 1
}

Thank you very much sir! Will definitely try.