Graph the last state of a case

I need to graph the last result of the cases and group them.

that is, how many cases do I currently have as a result in "en_seguimiento", "sin_respuesta" , or "SinVenta"...

In eslastic, a document is recorded for each result that a case has on time and a case can have a record with result x and then have a result y, so they handled this case.

what i need is to graph how many i currently have in the result "en_seguimiento", "sin_respuesta" , or "SinVenta"...

Currently I have a chart in kibana that tells me how many cases there have been for the different results, but it does not mean that it is the last result.

I've been thinking of using Transforming and groups for case identification, but I don't know how to say that I only saved in the last record of this Transforming.

Does anyone have an idea how I can graph this in kibana?

The other thing that I have tried is to make this graph with Vega, since to obtain the last records of each case I think that I can have it for this query, but I find it difficult to graph it because the answer of the last case is staying within inner_hits.

{ 
"query": {
"match_all": {}   
},
"collapse": {
"field": "caso_id.keyword",
"inner_hits": {
  "name": "most_recent",
  "size": 1,
  "sort": [{"caso_ts_ult_ges": "desc"}]
  }
 }
}

There is an example for this in the documentation of transform.

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