弹性搜索日期解析错误

时间:2015-11-13 00:44:48

标签: datetime elasticsearch logstash

我在配置弹性方面非常陌生,而且我在尝试解析日志日期时遇到了问题 - 这似乎应该是一件微不足道的事情。

对新手的任何见解?

 "error": {
      "root_cause": [
         {
            "type": "mapper_parsing_exception",
            "reason": "failed to parse [Message.LogTime]"
         }
      ],
      "type": "mapper_parsing_exception",
      "reason": "failed to parse [Message.LogTime]",
      "caused_by": {
         "type": "illegal_argument_exception",
         "reason": "Invalid format: \"2015-11-12 01:37:35.490\" is malformed at \" 01:37:35.490\""
      }
   }

我的JSON有效载荷

  {
    "LoggerType": "ErrorAndInfo",
    "Message": {
      "LogId": 0,
      "LogStatus": 0,
      "LogTime": "2015-11-12 01:37:35.490",
      "VersionInfo": "",
      "AdditionalInformation": null
    }
  }

弹性搜索模板映射

"mappings": {
    "log_message" : {
      "_all" : { "enabled": false },
      "properties": {
        "LoggerType" : { "type" : "string" },
        "Message" : {
          "properties": { 
            "LogId": { "type" : "integer" },         
            "LogStatus": { "type" : "integer" },
            "LogTime": { 
              "type" : "date",
              "format" : "yyyy-MM-dd HH:mm:ss.SSS"
            },
            "VersionInfo": { 
              "type" : "string",
              "index" : "not_analyzed"
            },
          }
        }
      }
    }
  }

1 个答案:

答案 0 :(得分:1)

我明白了。您必须为要应用的更改重新创建索引。