fblog icon indicating copy to clipboard operation
fblog copied to clipboard

Add support for epoch timestamps

Open axqd opened this issue 2 years ago • 2 comments

Hi,

It seems fblog cannot detect and convert epoch timestamps (in seconds / microseconds etc.) to a human-readable format automatically, which could be a very helpful feature to have.

Example:

{"time":"1705105985", ...}

axqd avatar Jan 15 '24 17:01 axqd

At the moment fblog does not interpret the timestamp. I just outputs the field.

bomgar avatar Jan 15 '24 17:01 bomgar

With the new config file support we could do something. But we would have to define the input and output format :thinking:

bomgar avatar Jan 15 '24 17:01 bomgar

for json logs, you can simply pipe to jq for performing any data transformations. For example to parse timestamps from kubectl output:

kubectl logs myPod | jq -c '.timestamp |= (. / 1000 | strftime("%Y-%m-%d %H:%M:%S"))' | fblog -c

arijoon avatar May 14 '24 16:05 arijoon

Already 4 upvotes. I did not expect this. I'll try to implement something soon.

bomgar avatar May 14 '24 16:05 bomgar

4.10.0

bomgar avatar May 21 '24 16:05 bomgar