duosecurity / duo_log_sync

MIT License
37 stars 28 forks source link

duologsync crashes on timestamp formatting #12

Open tsmori opened 4 years ago

tsmori commented 4 years ago

When running, the logs do get sent, but the app will crash with:

ValueError: time data '2020-09-29T15:06:14+00:00' does not match format '%Y-%m-%dT%H:%M:%S.%f+00:00'

Looking at the logs I'm receiving and I didn't see that isotimestamp contains the microsecond part of the formatting:

"isotimestamp": "2020-09-29T15:06:14+00:00"

I checked through a few hundred entries and didn't see it anywhere. Removing the .%f from duologsync/producer/producer.py and reinstalling fixed this for me.

Note that I do not know if the time formatting is configurable from the Duo side or if this is the default way the isotimestamp is configured. It would probably be better for any time stamp formatting to be put into the config and not hardcoded.