Splitting by document ID and do max aggregation to retrieve one value

I'm looking for a way in kibana to split data and recover only one value.

This is my data :

I splitted by the ID of the document.

Then I have done a min and max metric

Then with the plugin https://github.com/datasweet-fr/kibana-datasweet-formula I managed to make a custom metric (the delay between Date 1 and Date 2).

Then I have done the max of this metric (so the max delay is 38 there).

However, since I have splitted my data by the ID, I have the max value many times, and I only need it once.

I want it to display in a metric in kibana like this :

As you can see, the formula is displaying 107 because it's taking the delay between the min of ALL the Date 1 values and the max of ALL the Date 2 values. But I want it to split by DocumentID and then display the max of the metric.

I tried to use max bucket metric and other things but I didn't manage to make it work.

Is there a way to achieve this ?

The max appears to be across all the documents. I wonder if this is an issue with the Datasweet plugin.

It's not an issue, actually I would like to have the max of the column "Delay" but it's not a field and not a scripted field either so I can't have it like that. In order to have the values in this column I had to split the document to make individual calculations and then make a custom metric (with the datasweet plugin).

I wondered if we can do the max of this column but only to recover one value. Or is there a solution to do something else to have this value ?

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