Unknown time-zone ID: strict_date_hour_minute_second

I read the document and wrote a DSL query, but there was an error.

What is a time zone ID? It's not mentioned in the document.

quote doc
date_hour_minute_second or strict_date_hour_minute_second
A formatter that combines a full date, two digit hour of day, two digit minute of hour, and two digit second of minute: yyyy-MM-dd'T'HH:mm:ss .

GET /_search
{
  "size":1,
  "query": {
    "range": {
      "@timestamp": {
        "time_zone": "strict_date_hour_minute_second",        
        "gte": "2021-06-21T00:00:00Z", 
        "lte": "2021-06-27T23:59:59Z"                  
      }
    }
  }
}
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "java.time.zone.ZoneRulesException: Unknown time-zone ID: strict_date_hour_minute_second"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "java.time.zone.ZoneRulesException: Unknown time-zone ID: strict_date_hour_minute_second",
    "caused_by" : {
      "type" : "zone_rules_exception",
      "reason" : "Unknown time-zone ID: strict_date_hour_minute_second"
    }
  },
  "status" : 400
}

You are probably mixing the time format with the time_zone parameter... a timezone is something like CET or CEST, where as the format describes how a date looks like.

Hope this helps!

Sorry, I made a very simple mistake. Thanks for your answer.

1 Like