Skip to content

Commit b1a1a4e

Browse files
author
Colum Paget
committed
support 'dmesg' style timestamps
1 parent f114691 commit b1a1a4e

File tree

12 files changed

+1519
-8233
lines changed

12 files changed

+1519
-8233
lines changed

CHANGELOG

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
1.1 (2024-01-10)
2+
----------------
3+
* handle 'dmesg' style timestamps
4+
* handle timestamps wrapped in [] <> or {}
5+
6+
1.0 (2023-12-10)
7+
----------------
8+
* Initial release

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
OBJ=parse.o stats.o settings.o help.o libUseful-5/libUseful.a
2-
FLAGS=-g -O2 -DPACKAGE_NAME=\"timediff\" -DPACKAGE_TARNAME=\"timediff\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"timediff\ 1.0\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBZ=1 -DHAVE_LIBCRYPTO=1 -DHAVE_LIBSSL=1 -DHAVE_LIBCAP=1
3-
LIBS=-lcap -lssl -lcrypto -lz
4-
STATIC_LIBS=libUseful-5/libUseful.a
1+
OBJ=parse.o stats.o settings.o help.o
2+
FLAGS=-g -O2 -DPACKAGE_NAME=\"timediff\" -DPACKAGE_TARNAME=\"timediff\" -DPACKAGE_VERSION=\"1.1\" -DPACKAGE_STRING=\"timediff\ 1.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_LIBZ=1 -DHAVE_LIBUSEFUL_5_LIBUSEFUL_H=1 -DHAVE_LIBUSEFUL_5=1
3+
LIBS=-lUseful-5 -lz
4+
STATIC_LIBS=
55
PREFIX=/usr/local
66

77
all: $(OBJ)

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ All options that take a 'seconds' argument are floating point, so milliseconds c
7373
TIMESTAMP FORMATS
7474
=================
7575

76-
Timestamps are expected to be at the start of the line, and timediff can handle the formats `YYYY?mm?dd?HH:MM:SS?mmm` `HH:MM:SS?mmm YYYY?mm?dd` `bbb dd HH:MM:SS?mmm` where `?` is any character, `YYYY` is the year `mm` is the month number, `bbb` is the month short name (e.g. "Oct") `dd` is the day number, `HH` is the hour, `MM` is the minutes, `SS` is the seconds and `mmm` is milliseconds. The milliseconds component is optional, and if it's six digits instead of three, then timediff will parse it as nanoseconds.
76+
Timestamps are expected to be at the start of the line, and timediff can handle the formats `YYYY?mm?dd?HH:MM:SS?mmm` `HH:MM:SS?mmm YYYY?mm?dd` `bbb dd HH:MM:SS?mmm` `SSSS.mmm` where `?` is any character, `YYYY` is the year `mm` is the month number, `bbb` is the month short name (e.g. "Oct") `dd` is the day number, `HH` is the hour, `MM` is the minutes, `SS` is the seconds and `mmm` is milliseconds. The milliseconds component is optional, and if it's six digits instead of three, then timediff will parse it as nanoseconds. The 'SSSS.mmm' format is 'kernel/dmesg' style, where number of seconds since some date, either the unix epoch or boot-up, are used to indicate the time.
77+
78+
timediff can also handle these formats if they're wrapped in characters like [] <> or {}
7779

7880
example formats that have been seen to work:
7981

@@ -84,6 +86,7 @@ example formats that have been seen to work:
8486
2023/12/05 10:30:14 Connection from 192.168.8.1
8587
Dec 05 10:30:14 Connection from 192.168.8.1
8688
10:30:14.182543 Connection from 192.168.8.1
89+
[1000.234762] Starting up
8790
```
8891

8992

0 commit comments

Comments
 (0)