ScriptedField Time format question

(Adam Whittaker) #1


I am trying to get something like the Hour of day bar histogram that is
demonstrated on this page working:

It says to create a scripted field based on the timestamp like this:

Integer.parseInt(new Date(doc['OpenedDate'].value).format("H"))

I added my datetime field (openedDate) but it gives me and error when i got
to discover (an error occurred with your request).

I also tried swapping out my datetime field with the @timestamp field (as
per the sample) but i got the same error.

Any help would be appreciated.


Please update your bookmarks! We have moved to

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

(system) #2