# Elasticsearch Index mappings( version 6.5.4)

**URL:** <https://discuss.elastic.co/t/elasticsearch-index-mappings-version-6-5-4/309535>\
**Category:** Logstash\
**Created:** [July 13, 2022, 1:45pm UTC](https://discuss.elastic.co/t/elasticsearch-index-mappings-version-6-5-4/309535 "2022-07-13T13:45:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyrao\_72](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gyrao_72/32/108254_2.png) [@gyrao\_72](https://discuss.elastic.co/u/gyrao_72)\
**Post date:** [July 13, 2022, 1:45pm UTC](https://discuss.elastic.co/t/elasticsearch-index-mappings-version-6-5-4/309535/1 "2022-07-13T13:45:44Z")

</div>

I am using filebeat to fetch logs, logstash to filter, and pushing them to elasticsearch.  
I have created an index on elasticsearch **import-export-logger**.

This id mapping of **import-export-logger**.

```auto
{
  "import-export-logger" : {
    "aliases" : { },
    "mappings" : {
      "_doc" : {
        "properties" : {
          "@timestamp" : {
            "type" : "date"
          },
          "currentMilestone" : {
            "type" : "integer"
          },
          "date" : {
            "type" : "date",
            "format" : "yyyy-MM-dd HH:mm:ss.SSS"
          },
          "description" : {
            "type" : "text"
          },
          "exportFrequency" : {
            "type" : "keyword"
          },
          "exportQueueType" : {
            "type" : "keyword"
          },
          "facilityCode" : {
            "type" : "keyword"
          },
          "failedImportMilestone" : {
            "type" : "integer"
          },
          "fileURL" : {
            "type" : "text"
          },
          "jobCreatedDate" : {
            "type" : "date",
            "format" : "yyyy-MM-dd HH:mm:ss.SSS"
          },
          "jobID" : {
            "type" : "keyword"
          },
          "jobName" : {
            "type" : "keyword"
          },
          "jobType" : {
            "type" : "keyword"
          },
          "message" : {
            "type" : "text"
          },
          "requestID" : {
            "type" : "keyword"
          },
          "status" : {
            "type" : "keyword"
          },
          "successfulImportMilestone" : {
            "type" : "integer"
          },
          "tenantCode" : {
            "type" : "keyword"
          },
          "totalMilestone" : {
            "type" : "integer"
          },
          "userName" : {
            "type" : "keyword"
          }
        }
      }
    },
    "settings" : {
      "index" : {
        "creation_date" : "1657625688183",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "TWK_Ha4ZR9SUSDCwXyLeGA",
        "version" : {
          "created" : "6050499"
        },
        "provided_name" : "import-export-logger"
      }
    }
  }
}

```

This is the output section of logstash config file

```auto
elasticsearch {
		hosts => ["localhost:9200"]
		index => "import-export-logger-%{index-name}"
		http_compression => true
	}

```

Here I want elasticsearch to create a new index but with the mapping of **import-export-logger** index rather tan creating new mapping on its own.

Mapping for output index **import-export-logger-2020-11-06** is

```auto
{
  "import-export-logger-2020-11-06" : {
    "mappings" : {
      "doc" : {
        "properties" : {
          "@timestamp" : {
            "type" : "date"
          },
          "beat" : {
            "properties" : {
              "hostname" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "name" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "version" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              }
            }
          },
          "created_timestamp" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "currentMilestone" : {
            "type" : "long"
          },
          "current_timestamp" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "description" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "exportFrequency" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "exportQueueType" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "facilityCode" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "failedImportMilestone" : {
            "type" : "long"
          },
          "fields" : {
            "properties" : {
              "target_index" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              }
            }
          },
          "fileURL" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "index-name" : {
            "type" : "date"
          },
          "jobID" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "jobName" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "jobType" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "message" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "requestID" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "source" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "status" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "successfulImportMilestone" : {
            "type" : "long"
          },
          "tags" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "tenantCode" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "totalMilestone" : {
            "type" : "long"
          },
          "userName" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          }
        }
      }
    }
  }
}

```

Can anyone help me with how should I configure my files to get the desired mapping

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 13, 2022, 2:35pm UTC](https://discuss.elastic.co/t/elasticsearch-index-mappings-version-6-5-4/309535/2 "2022-07-13T14:35:53Z")

</div>

Hi @gyrao_72 Welcome to the community!

**First 6.5 is incredibly old and EOL** and you should update as a matter of urgency.

2nd Did you create an index template?

You did not show the actual command you use to create your template did you just create a single mapping... unclear what you did..

> [@gyrao\_72](#):
>
> ```auto
> {
> "import-export-logger" : {
> "aliases" : { },
> "mappings" : {
> "_doc" : {
> 
> ```

What you need to do is great an Index Template, which matches the index name and applies the template

> **[Index Templates | Elasticsearch Guide \[6.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html)**

something like.... this is how a mappings gets applied to a pattern of index names

```auto
PUT _template/import-export-logger-template
{
  "index_patterns": ["import-export-logger-*"], <!-- This is how your index gets match to the mapping 
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {

```

---

<div class="post-metadata">

**Author:** ![gyrao\_72](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gyrao_72/32/108254_2.png) [@gyrao\_72](https://discuss.elastic.co/u/gyrao_72)\
**Post date:** [July 13, 2022, 4:14pm UTC](https://discuss.elastic.co/t/elasticsearch-index-mappings-version-6-5-4/309535/3 "2022-07-13T16:14:36Z")

</div>

Hi @stephenb

Thank you for your early reply.  
Creating template solution worked.

And the reason why I am using v6.5.4 is that my organization is using this version but maybe in the next quarter they will be upgrading to a newer version

Thank you once again

---

<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:** [August 10, 2022, 4:14pm UTC](https://discuss.elastic.co/t/elasticsearch-index-mappings-version-6-5-4/309535/4 "2022-08-10T16:14:58Z")

</div>

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