Kibana - Count on the data with filter condition is on last data category

Hi all. I am a newbie, I need your help.
Let say i have the log like this:

14/Jul/2021:00:00:05 CONTRACT_NO1 SUCESS content1
14/Jul/2021:00:00:06 CONTRACT_NO1 SUCESS content2
14/Jul/2021:00:00:07 CONTRACT_NO2 SUCESS content3
14/Jul/2021:00:00:08 CONTRACT_NO2 SUCESS content4

and use LogStash with filter to parse log to the structured data: datetime, contract_no,status,content.

In kibana, i wanna count how many processes are successful for the LAST contract (in this case: CONTRACT_NO2) in real-time.
If there is a new CONTRACT_NO3 come, the dashboard will AUTOMATICALLY change to count on CONTRACT_NO3.
I tried many ways but didn't work!. Please help. Thanks

anyone, please.