Timestamp Difference between two fields


(Berin) #1

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

Thanks,
Berin.


(kulkarni) #2

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.

Thanks
Rashmi


(Berin) #3

Hi Rashmi,

Thanks for your email.

Details:-

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 -
doc['RequestReceivedbyLoadManager'].value

Also i have attached few screenshots for your reference

Regards,
Berin


(kulkarni) #4

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.

Cheers
Rashmi.


(system) #5

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