My problem is this, I need to create a field in kibana which is the subtraction of two date fields ex (2017-01-01 - 2017-01-11) where the result would be 10 days
Script
I'm creating a painless doc ['date1']. Value - doc ['date2']. Value is not working
help me
You can look at the index pattern to see. For example my date1 and date2 are dates (they're also scriptable and aggregatable which I think they need to be if you use them in a scripted field);
Then I created this scripted field (the difference in dates is in milliseconds so I divide by 1000 to get seconds, by 60 to get minutes, by 60 to get hours, by 24 to get days); (doc['date2'].value - doc['date1'].value) / 1000 / 60/ 60 /24
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.