Hello.
Facts:
-
Using ElasticSearch version 5.6.10
-
Currently, the Template [1] for one of my indices contains a section like this, since LogStash is creating field "my_datefield" as a string, with one of these two patterns.
"my_datefield": { "type": "date", "format": "MM/dd/yy HH:mm:ss||MM/dd/yy HH:mm:ss.SSS" }, -
I need to change the way LogStash builds "my_datefield", to use the Filter plugin Date. Therefore, the type of "my_datefield" won't be anymore a "string" but a "LogStash::Timestamp" type. "my_datefield" will look like this
"my_datefield" => 2019-08-01T20:55:48.719Z -
I assume I can create a new Template [2] to address the new type, like this
"my_datefield": { "type": "date" }, -
My understanding is that the new Template [2] only will affect new indices. Correct? As they are created daily, "my_index-yyyy.mm.dd", that means Template [2] will start being used the day after I set it up, right?
So my question is how to allow ElasticSearch to accept both types, string and timestamp, during the day of the transition. The day I set the new code for LogStash, the index for that day still uses Template [1], but "my_datefield" won't be a string anymore. My experiments tell me that ElasticSearch will reject the new documents as it does not know how parse the field "my_datefield" anymore. Is there a solution for this?
Thanks a lot in advance.
