Filters and subscriptions
An event that generates a log in Ethereum is searchable with a bloom filter.
Bloom filters are space-efficient probabilistic mechanisms for identifying whether an element is likely to be within a set.
Ethereum methods use this underlying implementation to search for and retrieve specific data from the Ethereum blockchain by polling with filter methods via HTTP or listening with subscription methods via WebSocket.
Check out the documented HTTP filter method specifications.
Check out the documented WebSocket subscription specifications.