Date Column difference in days using Scripted fields

Hi,
I am trying to get the difference between 2 date columns in days. I have used painless language and created a scripted field column. The issue here is, the difference in days between the end of the year and start of the next year creates problem and getting wrong values. please let me know, how to handle this and get the exact difference in days.

doc['received_dt'].date.dayOfYear- doc['start_dt'].date.dayOfYear

Hi! I found this discuss post that might be similar to what you are asking:

There is also this blog post: Using Painless in Kibana scripted fields | Elastic Blog

Can you check it out and see if it helps?

Liza, Yes the discussion post helped me to narrow down the things. Thanks!

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