0

Given timestamp in UTC format in elasticsearch documents.

The week day and hour of the day aggregations can be retrieved using inline scripts eg.

    "script": {
          "lang": "painless",
          "inline": "doc['eventTime'].date.dayOfWeek"
        }
        

From above weekDay buckets will be evaluated on the basis of UTC time.

Ques: How can we get the week day buckets in other timezone ? eg. Asia/Singapore timezone from UTC timezone.

  • This question has been asked in a similar format before. See this link https://discuss.elastic.co/t/is-it-possible-to-apply-a-timezone-to-a-date-in-a-scripted-field/65372 – AdamPillingTech Dec 20 '17 at 10:02
  • Thanks @PillHead, I used "script": { "lang": "painless", "inline": "doc['eventTime'].date.dayOfWeek", "params": { "timeZone" : "GMT+9" } } – Jay Prakash Meena Dec 28 '17 at 15:01

1 Answers1

0

Found later. It's the same In Elasticsearch, how can I apply a timezone to a scripted date operation?

   "script": {
      "lang": "painless",
      "inline": "doc['eventTime'].date.dayOfWeek",
      "params": {
        "timeZone" : "GMT+9"
      }
    }