Hi there! Could you help me with a question, please?
I have an application that sends logs to elasticsearch to log and track the status of a purchase.
Example:
{"idcode": "a1", "order_status":"approved","timestamp": 1563041808958}
{"idcode": "a1", "order_status":"under_analysis","timestamp":1563041793374}
{"idcode": "a2", "order_status": "waiting_payment","timestamp":1563041760591}
{"idcode":"a1", "order_status":"waiting_payment", "timestamp":156304110293}
I would like to make a visualization on kibana that shows how many purchases are in a certain status without counting the status that a purchase already had.
for example:
Status Tracking Table
I've already tried creating a table where my metric is "Count" and bucket has aggregation "Terms", field is order_status.
When I do this I get the view I want, but it does not only count the last purchase status, but all the statuses a purchase has already had. This way the view goes out wrong
Just to explain:
Let's image that the first log was
{"idcode":"a1", "order_status":"waiting_payment", "timestamp":156304110293}.
and we have another log line immediately after the first one that is
{"idcode": "a1", "order_status": "under_analysis", "timestamp": 1563041793374}
I am trying to create a table visualization which show something like this
But currently I have this:
That is, it is computing the old and new status
Also, I've already tried creating a table where my metric is "top hit", the field is order_status , sort onis time_stamp and buckets with aggregation:terms, field:idcode. But it just shows the lastest state by idcode, in others words it does not work as the visualization that I want.
Could you help me with this question?
any help will be appreciated!!
Thank you very much!