I have a basic date diff between 2 dates to do and display it as weeks.
If i use the Kibana scripted fields, it works fine using the following syntax :
Math.round((doc['last_detected'].value.toInstant().toEpochMilli() - doc['first_detected'].value.toInstant().toEpochMilli())/((3600000*24))/7)
However, I would like to have it calculated during the document ingestion but i can not figure which is the syntax ?
Any guess ?