eth_getFilterLogs
The eth_getFilterLogs method returns an array of all logs matching a filter created with eth_newFilter. Unlike eth_getFilterChanges which returns only new logs since the last poll, this method returns the complete set of logs that match the filter criteria from the filter's creation block range.
This method is particularly useful when you need to retrieve all historical logs for a filter without incrementally polling for changes. It's commonly used to get the full initial state of events when an application starts, recover from missed polls, or verify the complete set of logs matching specific criteria. The method works only with filters created via eth_newFilter and returns all matching logs regardless of how many times you call it.
Filters timeout after 5 minutes of inactivity. This method resets the filter timeout, keeping it active.
Parameters
parameter | type | description |
|---|---|---|
filterId | string (required) | The filter ID returned from eth_newFilter |
Return Object
field | type | description |
|---|---|---|
result | string | An array of all logs matching the filter. Each log object contains address, topics, data, blockNumber, transactionHash, transactionIndex, blockHash, logIndex, and removed fields |
Request Example
Response Example