2015-11-13 86 views
1

我在配置弹性方面很新颖,而且我在尝试解析日志日期时遇到了问题 - 这看起来应该是一件微不足道的事情。弹性搜索日期分析错误

任何洞察力的新手吗?

"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

我没有创建索引和索引该示例文档的麻烦。你可以显示你正在运行的命令1)创建索引+映射和2)索引文件? – Val

回答

1

我想通了。您将不得不重新创建索引以应用所做的更改。