1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-08-06 22:32:54 +02:00

add timestamps

This commit is contained in:
Kelly Brazil
2022-08-14 11:48:41 -07:00
parent 23263bd83e
commit 81ed9c0c5c

View File

@ -129,6 +129,13 @@ def _process(proc_data: List[Dict]) -> List[Dict]:
if item[key]:
item[key] = value.strip()
# add timestamp fields
if item['timestamp']:
format = (1300, 1310)
dt = jc.utils.timestamp(item['timestamp'], format)
item['timestamp_epoch'] = dt.naive
item['timestamp_epoch_utc'] = dt.utc
# fixup escaped characters
if item['message']:
for esc, esc_sub in escape_map.items():