Hi,
I keep running into this error when I try to index documents and use user_agent to parse a field that includes user agent information:
{
"type": "mapper_parsing_exception",
"reason": "failed to parse field [connections_user_agent.version] of type [date] in document with id '2'. Preview of field's value: '119.0.0.0'",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "failed to parse date field [119.0.0.0] with format [strict_date_optional_time||epoch_millis]",
"caused_by": {
"type": "date_time_parse_exception",
"reason": "Failed to parse with all enclosed parsers"
}
}
}
This is happening because if I fed user_agent with
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0
that "20100101" bit is parsed as date causing user_agent.version to be mapped as date.
So, when later I try when I feed user_agent with
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
I get the error above because "119.0.0.0" is not a valid date.
I tried to solve this by explicitly mapping user_agent.version as text / keyword while the index is empty, but no success: ES seems to ignore the existing mapping and re-maps user_agent.version as date.
Suggestions?