hourOfWeek aggregation attempt results do not match date histogram by hour aggregation

I'm trying to replicate the results of this data histogram aggregation but bucket by hour of week (0 through 168) instead:

"dateByHour": {
      "date_histogram": {
        "field": "event_timestamp",
        "interval": "1h",
        "time_zone": "America/Chicago",
        "min_doc_count": 1
      }
 }

My attempt is delivering similar results for some hours, and results about 5x off for others:

"hourOfWeek": {
    "terms": {
        "script": {
            "lang": "painless",
            "inline": "doc['event_timestamp'].date.dayOfWeek * doc['event_timestamp'].date.hourOfDay"
        },
        "size": 168
    }
}

Any ideas of what I may be doing incorrectly?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.