Hi,
I'm trying to make my first transform and I'm not getting the results I expect. My source has multiple events correlated by a command_unique_id
and I want to find the duration of these events by getting the timestamp difference between the last event and the first. This feels very similar to the Getting duration by using bucket script example, but my output index is not showing any of my aggregate fields. Hopefully, I'm missing something obvious
My pivot configuration object:
{
"group_by": {
"command_unique_id": {
"terms": {
"field": "command_unique_id"
}
}
},
"aggregations": {
"start-time": {
"min": {
"field": "timestamp"
}
},
"end-time": {
"max": {
"field": "timestamp"
}
},
"time_duration": {
"bucket_script": {
"buckets_path": {
"start": "start-time",
"end": "end-time"
},
"script": "params.end - params.start"
}
}
}
}
One of the documents in my destination index: