summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2014-07-19 12:41:06 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2014-07-19 12:41:06 +0200
commitb01b3a1c2e6e762f6114d14e2a500a778a7b6a1d (patch)
tree25e12ddfaf0f271d214f3b67536b19d85b613339
parentb12542661ca847090465c30351871ee4947f9e3b (diff)
downloadsocklog-void-b01b3a1c2e6e762f6114d14e2a500a778a7b6a1d.tar.gz
socklog-void-b01b3a1c2e6e762f6114d14e2a500a778a7b6a1d.tar.xz
socklog-void-b01b3a1c2e6e762f6114d14e2a500a778a7b6a1d.zip
add syslog-stripdate
-rw-r--r--Makefile1
-rwxr-xr-xsyslog-stripdate8
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 /'