elasticsearch,format,logstash,jodatime,Datetime,elasticsearch,Format,Logstash,Jodatime" /> elasticsearch,format,logstash,jodatime,Datetime,elasticsearch,Format,Logstash,Jodatime" />

Datetime Elasticsearch joda时间格式错误

Datetime Elasticsearch joda时间格式错误,datetime,elasticsearch,format,logstash,jodatime,Datetime,elasticsearch,Format,Logstash,Jodatime,我正在尝试使用logstash在elasticsearch中导入json格式的日期。我正在使用以下映射: "time_stamp": { "type": "date", "format": "dd-MMM-yy HH:mm:ss aa zzz" } 并尝试导入09-Dec-16格林尼治时间下午6:15:00,并获得以下错误 [2017-01-12T15:41:34,501][WARN ][logstash.outputs

我正在尝试使用logstash在elasticsearch中导入json格式的日期。
我正在使用以下映射:

   "time_stamp": {
            "type": "date",
            "format": "dd-MMM-yy HH:mm:ss aa zzz"
          }
并尝试导入
09-Dec-16格林尼治时间下午6:15:00
,并获得以下错误

[2017-01-12T15:41:34,501][WARN ][logstash.outputs.elasticsearch] Failed action. {
  : status=>400,
  : action=>[
    "index",
    {
      : _id=>nil,
      : _index=>"energy-2017.01.12",
      : _type=>"pam1",
      : _routing=>nil
    },
    2017-01-12T15: 41: 34.397Z%{
      host
    }%{
      message
    }
  ],
  : response=>{
    "index"=>{
      "_index"=>"energy-2017.01.12",
      "_type"=>"pam1",
      "_id"=>"AVmTV2GcrRd08tiPC0IZ",
      "status"=>400,
      "error"=>{
        "type"=>"mapper_parsing_exception",
        "reason"=>"failed to parse [time_stamp]",
        "caused_by"=>{
          "type"=>"illegal_argument_exception",
          "reason"=>"Invalid format: \"09-Dec-16 6:15:00 PM GMT\" is malformed at \"-Dec-16 6:15:00 PM GMT\""
        }
      }
    }
  }

你知道我为什么会出现这个错误吗?

你可能应该指定区域设置为英语。为什么你的输入中有24小时值(15)和am/pm标记的组合???我相信这不是24小时,15是分钟。我刚刚试着将locale设置为英语,即“locale”:“english”,但这似乎没有任何效果。啊,好的,分钟,你的未格式化错误消息对我来说不容易阅读。现在我看到下午6:15:00。但是,您应该真正使用模式部分“h:mm:ssa”(小“h”)。再说一次,尽管我无法告诉您如何在elasticsearch的上下文中准确地将区域设置为英语。我认为它可能在月份部分(即12月)遇到困难,不知道如何用纯Java解析:
String input=“09-Dec-16 6:15:00 PM GMT”;DateTimeFormatter dtf=DateTimeFormat.forPattern(“dd-MMM-yy h:mm:ss-aa-zzz”)。带有语言环境(Locale.ENGLISH);DateTime dt=dtf.parseDateTime(输入)适合我。