With the aggregation below and using ES5, I'd like to get the dayOfWeek & hourOfDay based on a given timezone (supplied as an identifier from the TZ database).
How can I edit "doc['created'].date.dayOfWeek'
to adjust for the offset?
aggs: {
dayOfWeek: {
terms: {
script: {
inline: "doc['created'].date.dayOfWeek",
lang: 'painless',
},
},
aggs: {
hourOfDay: {
terms: {
script: {
inline: "doc['created'].date.hourOfDay",
lang: 'painless',
},
},
},
},
},
},