Invalid format: [yyyy-MM-ddTHH:mm:ssZ]: Unknown pattern letter: T"

Hello team,

strange thing happened. I have following mapping for the field in els with multiple formats:

"createdAt" : {
                  "type" : "date",
                  "format" : "yyyy-MM-dd HH:mm:ssZ||yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss a Z||yyyy-MM-dd a HH:mm:ss Z||yyyy-MM-dd'T'HH:mm:ssZ||yyyy-MM-dd HH:mm:ss a, Z"
                }

Unfortunately when I try to update it and append one more format I got:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Error parsing [format] on field [data_event_generalSessionData_lastSessionTimeStamp]: Invalid format: [yyyy-MM-ddTHH:mm:ssZ]: Unknown pattern letter: T"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Error parsing [format] on field [data_event_generalSessionData_lastSessionTimeStamp]: Invalid format: [yyyy-MM-ddTHH:mm:ssZ]: Unknown pattern letter: T",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "Invalid format: [yyyy-MM-ddTHH:mm:ssZ]: Unknown pattern letter: T",
      "caused_by" : {
        "type" : "illegal_argument_exception",
        "reason" : "Unknown pattern letter: T"
      }
    }
  },
  "status" : 400
}

Added pattern is: yyyy-MM-dd'T'HH:mm:ssz

What version are you on?
I just ran this with no issues on 7.10.1;

PUT test/
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ssZ||yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss a Z||yyyy-MM-dd a HH:mm:ss Z||yyyy-MM-dd'T'HH:mm:ssZ||yyyy-MM-dd HH:mm:ss a, Z"
      }
    }
  }
}

Response;

{
  "acknowledged" : true,
  "shards_acknowledged" : true,
  "index" : "test"
}

7.9.2 we run, all elk stack products elastic, kibana and logstash..

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