I have two date fields in my Elasticsearch index: 1. Submit_Date & 2. Completed_Date.
I want to add new field which will be diff between Completed_Date and Submit_Date...
but if Completed_Date is empty I want the diff between current system timestamp and Submit_Date...
Computing data on the fly with scripted fields can be very resource intensive and can have a direct impact on Kibana performance. Keep in mind that there’s no built-in validation of a scripted field. If your scripts are buggy, you’ll get exceptions whenever you try to view the dynamically generated data.
Use something like this to check if field exist in the doc
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.