Scripted Fields Date Math

Painless intentionally doesn't expose .now() style methods per Groovy to Painless; get current date time

You can get the milliseconds of the document's @timestamp field using the following doc['@timestamp'].value.getMillis()