Yelp/osxcollector

Timestamp keys are incorrectly mapped to numbers instead of datetime-based strings when invalid

leeren opened this issue · 0 comments

When a timestamp-based key has a corresponding value which is unable to be successfully rendered as a valid timestamp (as in the line below), the timestamp is returned as None and later logged in its corresponding dictionary as a Number value.

ts = _value_to_datetime(val)

This can cause type-conflicting issues when further ingesting output JSON data into analytics services such as Elasticsearch. A simple fix is to always have timestamp-based keys return strings corresponding to super early epoch timestamps (e.g. '1970').