Hello,
I'm currently struggling with an annoying problem who lead to many lost logs into my Elastic cluster.
The problem happen when a field that hasn't been defined into the default filebeat template is created. When the filebeat is sending a data with a new field, the field will be created into the index. But the type of this field may not always be the same.
For example, if the value contain a number at first, the field will be created as "long". If the field as a string as its value at first, it field will be "keyword".
This is causing lots of problem. Here is a very nice error I'm getting:
response: {"index"=>{"_index"=>"filebeat-8.6.2-o365-2023.12.19", "_id"=>"4ENEgowBcZxL1t679ex9", "status"=>400, "error"=>{"type"=>"document_parsing_exception", "reason"=>"[1:1064] failed to parse field [o365.audit.Platform] of type [long] in document with id '4ENEgowBcZxL1t679ex9'. Preview of field's value: 'OfficeCollaborationService'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"For input string: \"OfficeCollaborationService\""}}}}
Because the first value for the field o365.audit.Platform
was a number, the field has been created with a type of long
. Why the first value had a number in it? I can't tell that, this comes from Office365. But I know that value must be a string. When another record comes with a sting for that field, it will failed to parse the data and it will be lost. In the example above, we can see the value it tries to parse on field 365.audit.Platform
is OfficeCollaborationService
. This one will failed because the destination field has a type of long
.
Since a number can fit into a test or keyword field, is there a way to tell Elastic to create any fields, that isn't part of the index template that comes with filebeat
, usunbg a type of text
or keyword
?
From this index, I currently have 5 conflicts, all related to keyword,long type.
If there is a way to solve this situation, I will appreciate it!
If you need more information on this issue, please let me know.
Thank you all and best regards,
Yanick