I'm wondering if there is a way to throttle events in pure python. For example, usually other tools have a way to look at a specific event, say:
{"id":111,"message":"hello","host":"example"}
and there might be another event that comes right after or within a time interval that looks like:
{"id":112,"message":"hello","host":"example"}
Given these two events, you typically can look at 2 keys in the events, so for this example, the message key and the host key have the same values between the two events. Because these 2 events have the same key and value, you can treat them as one. This is how I would like to go about "throttling".
I'm wondering if there is a good way to do this in python, I'm thinking about using a database/redis but unsure what the best method is to approach this. For the events, the id is unique.
Thanks!
EDIT: I have actually already accomplished this is Logstash, but I was looking for a way to do it in pure python.