We have a daily generic logstash-YYYY.mm.dd index that many clients insert various documents into. However, one client was using meta-field “{_type: posts}” while others' documents were being rejected because they used “{_type: fluentd}”. The first client (using type posts) was pointing directly at one Elasticsearch data node.
Then something happened to that host where the elasticsearch process stopped. When we restarted elasticsearch on that host, suddenly all documents with “{_type: posts}” were rejected and only accepted “{_type: fluentd}” documents. This is the message the first client was seeing … "Rejecting mapping update to [logstash-2020.04.17] as the final mapping would have more than 1 type: [posts, fluentd]"
We want to accept the “{_type: posts}” documents again moving forward from today on, even at the expense of rejecting other types. Though not ideal, unfortunately the clients can not make any changes on their end so we have to fix it on our end.
How do I enforce the logstash indices to accept only "{_type: posts}" documents going forward as they are generated daily?
I'm not sure if makes a difference or not but our Elasticsearch version is 6.8.
Question 1:
From reading the link you provided, does it seem like creating a custom field called "type" under the "Custom type field" section should be my preferred alternative?
Question 2:
If so, would this be the command to issue to act on today's (already-existing) or tomorrow's (not created yet) index?
Unfortunately I'm new to Elasticsearch and not sure how to go about implementing the changes you suggest. For example, I dont know how to find out which template is for our logstash indices.
How similar are your posts and fluentd documents/logs?
It looks like posts and fluentd documents are very different. They have very different fields.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.