Timestamp Difference between two fields

Hi Team,

I am new to this Elastic search/ Kibana , we need to calculate the timestamp difference between two fields, In fact i even tired with scripted fields , using painless scripts "doc['startTime'].value - doc['EndTime'].value" , it dint work. Also whenever i use scripted field and select the index , under discover tab , could see a warning msg Courier Fetch 2 0f 5 shards failed". Appreciate your help


This is likely an indication that there's a problem with your cluster's health. Without knowing more about your cluster, there's not much more that can be said. Can you provide more details - version, steps, screenshots, logs.


Hi Rashmi,

Thanks for your email.


Version:- elasticsearch-6.2.3 / kibana-6.2.3
Steps for scripted scripts:-
select Language :- painless
Type:- Number
Format : Duration (seconds, human readable)
script :- doc['FinalloadCompletehappened'].value -

Also i have attached few screenshots for your reference


Hi Berin,

The error message seems misleading. Its a generic your script failed message, there should be more info in the network tab in the browser. If I had to take a guess this script needs to make sure both fields exist before checking for .value !doc[field].empty.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.