hey guys,
this is my script (found it online), unfortunately it keeps returning "0".
Field Type:
Number
Script:
return Period.between (
doc['@timestamp'].value.toLocalDate(), Instant.ofEpochMilli(System.currentTimeMillis()).atZone(doc['@timestamp'].value.getZone()).toLocalDate() ).getYears()
do you have any idea why?