Date format in scientific notation. ES v1.5 / v2.3 incompatibility


(Xavi Ramirez) #1

Hello,

I'm currently in the middle of migrating our elasticsearch cluster from v1.5 to v2.3. Most very went smoothly except this one date issue:

Old Request:

POST http://my-elasticserach-v15-cluster/logs-2016.09.16/daily-logs/1

Body:

{"Timestamp": 1.473977633e+12, "hi": "hi"}

Response:

{
  "_index": "logs-2016.09.16",
  "_type": "daily-logs",
  "_id": "1",
  "_version": 1,
  "created": true
}

New Request:

POST http://my-elasticserach-v23-cluster/logs-2016.09.16/daily-logs/1

Body:

{"Timestamp": 1.473977633e+12, "hi": "hi"}

Response:

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse [Timestamp]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse [Timestamp]",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "Invalid format: \"1.473977633e+12\" is malformed at \".473977633e+12\""
    }
  },
  "status": 400
}

It seems like v1.5 accepted dates in scientific notation but v2.3. Is there get the old behavior back? This is what my v2.3 index template looks like:

"timestamp": {
    "type": "date",
    "format": "dateOptionalTime||date_time||epoch_millis||epoch_second"
},

Thanks!


(system) #2