Calculate difference in Time from 2 Fields in OpenSearch Dashboard

Hi
I have 2 date types columns in OpenSearch Document Table Visualization and I want to calculate the Time difference between the 2 columns
Example:

Col1: Jun 16, 2022 , 08:37:27.651
Col2: Jun 16, 2022 , 08:30:00.000

Output Required

Col3_diff: 07:27:651

Is there any way to do so in OpenSearch Dashboard Please help?
Thanks

Hello,

One way to achieve this is to create a scripted field with a painless script.
Go to OSD > Stack Management > Index patterns and choose the index pattern you want to work on. Click on Scripted field and add your new field:

The example is not exactly what you need (time difference) but gives you a starting point.

Hope it helps.

PS : You can use scripted fields in visualizations and display them in your documents. However, you cannot search scripted fields.

Lionel

Another way could be to use the enhanced table plugin from https://github.com/fbaligand/kibana-enhanced-table.
Releases are available for OSD:: https://github.com/fbaligand/kibana-enhanced-table/releases/tag/v1.13.1