I am learning kibana but i would like to know how to perform the subtraction. For example, we have two fields "starting = 2018-05-15 12:20:03.400779 , ending=2018-05-15 12:20:03.360979" . Can please know is there anyway to calculate duration (ending - starting) as a field. i am having hard to implement it as scripted field. Any help would be appreciated.
Yep, it can be done.
If you have two date fields (time1 and time2) you can write a script like this: doc['time2'].value - doc['time1'].value
You'll also want to have the scripted field with
type: number
Format: Duration
InputFormat: seconds (if you use the date fields as normal UNIX timestamp)
OutputFormat: Human Readable
Thank you for the reply. when i tried the same thing as you mentioned above , i am getting an error "15 out of 70 shards failed" and kibana is not displaying any results.
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.