You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TimeParser gives wrong results for UNIX-timestamps with micro- and nanoseconds.
This happens because it assumes UNIX timestamps are given in microseconds if they are longer than 10 digits and divides by 1000.
Expected behavior
The TimeParser should parse UNIX timestamps corretly if their granularity is microseconds or nanoseconds.
Steps to reproduce
Use the Timestamper processor on events with UNIX timestamps with 16 (microsecond) or 19 (nanosecond) digits.
Environment
Logprep version: 13.4.0
Python version: 3.11
Possible solution
Divide UNIX timestamps by 10 ** (len(timestamp) - 10) instead of dividing it by 1000 or slice the timestamp to 13 digits if it's longer.
The problematic code is parsed_datetime = int(timestamp) if len(timestamp) <= 10 else int(timestamp) / 1000 in util/time.py.
The text was updated successfully, but these errors were encountered:
The TimeParser gives wrong results for UNIX-timestamps with micro- and nanoseconds.
This happens because it assumes UNIX timestamps are given in microseconds if they are longer than 10 digits and divides by 1000.
Expected behavior
The TimeParser should parse UNIX timestamps corretly if their granularity is microseconds or nanoseconds.
Steps to reproduce
Use the Timestamper processor on events with UNIX timestamps with 16 (microsecond) or 19 (nanosecond) digits.
Environment
Logprep version: 13.4.0
Python version: 3.11
Possible solution
Divide UNIX timestamps by
10 ** (len(timestamp) - 10)
instead of dividing it by 1000 or slice the timestamp to 13 digits if it's longer.The problematic code is
parsed_datetime = int(timestamp) if len(timestamp) <= 10 else int(timestamp) / 1000
inutil/time.py
.The text was updated successfully, but these errors were encountered: