diff options
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | syslog-stripdate | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile index 3ae7574..4f96b6e 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ all: nanoklogd install: all install -Dm755 nanoklogd ${DESTDIR}/usr/bin/nanoklogd install -Dm755 svlogtail ${DESTDIR}/usr/bin/svlogtail + install -Dm755 syslog-stripdate ${DESTDIR}/usr/bin/syslog-stripdate mkdir -p ${DESTDIR}/etc ${DESTDIR}/var/log cp -a sv ${DESTDIR}/etc cp -a socklog ${DESTDIR}/var/log diff --git a/syslog-stripdate b/syslog-stripdate new file mode 100755 index 0000000..cb84619 --- /dev/null +++ b/syslog-stripdate @@ -0,0 +1,8 @@ +#!/bin/sh +# syslog-stripdate - remove superfluous timestamp from socklog->svlogd +# +# 2014-07-19T10:20:24.52892 user.notice: Jul 19 12:20:24 xbps-install: ... +# turns to +# 2014-07-19T10:20:24.52892 user.notice: xbps-install: ... + +sed 's/^\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9][0-9][0-9] [a-z]*\.[a-z]*:\) ... [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] /\1 /' |