No, it won't. doc['@timestamp'].value.getMillis() gives you the absolute number of milliseconds that the document's @timestamp field is past the epoch. Painless intentionally doesn't exist .now() style methods and recommends alternate approaches since the clocks on the various Elasticsearch nodes are potentially out of sync and occur during various times, so this likely isn't what you want to do.
@kb2295 if you were using ES directly, you could pass the current datetime as a parameter to the script so we had a consistent thing to compare against, but this isn't really feasible in the context of Kibana since we don't support that.
Would you mind elaborating on the end-result that you're trying to achieve in the context of Kibana?
I have a field in each doc called "lastUpdated" this is a time field that captures the time the specified doc was updated. I need to see how long it's been in real time since the doc was updated.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.