Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ES Input]Caused by: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot invoke method public org.joda.time.DateTime org.joda.time.format.DateTimeFormatter.parseDateTime(java.lang.String) #357

Closed
garyelephant opened this issue Aug 8, 2019 · 0 comments

Comments

@garyelephant
Copy link
Contributor

ES Input 报错:

Caused by: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot invoke method public org.joda.time.DateTime org.joda.time.format.DateTimeFormatter.parseDateTime(java.lang.String)

发现是index中date类型的mapping设置如下:

"stat_time": {
    "type": "date",
     "format": "yyyy-MM-dd HH:mm:ss"
},

问题原因是ES-Hadoop date格式数据解析仅支持ISO8601 格式的,举例:yyyy-MM-dd'T'HH:mm:ss.SSSZZ,这个格式会解析报错yyyy-MM-dd HH:mm:ss.

解决方案是:

input {
  es {
    ...
    es.mapping.date.rich = false
    ...
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant