obsrvbl-oss / flowlogs-reader

Command line tool and Python library for working with AWS VPC Flow Logs
Apache License 2.0
136 stars 25 forks source link

New direction for handling failed flowrecords #60

Closed BThacker closed 1 year ago

BThacker commented 1 year ago

The idea behind this is to simply try catch the init of FlowRecord, and if an exception is caught, increment the "skipped_records" field of the basereader class. This value can then be checked and logged in the consuming class for further investigation if warranted. Also added an override during class init to raise the exception instead.

bbayles commented 1 year ago

Suggestions:

BThacker commented 1 year ago

Added skipped records to the base reader, added all exceptions to the catch (good point)

BThacker commented 1 year ago

Dropped the multiple return types and just incremented the counter instead. Consuming modules can check the skipped record value and then log based on that.

BThacker commented 1 year ago

removed the unnecessary var creation, direct to yield