summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-04 00:27:55 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-04 00:28:00 +0100
commit5034c7bcdfc4493ed3c30722e9d897c8da78fede (patch)
treeea3b312f4f21c880cfc058e9dd5abfc7444d78a8
parent78fe420ff0bb4cd94de3c4d3f15a3021cc3e2878 (diff)
journald: suppress low-level audit text prefix in MESSAGE= field
Let's make the log output more readable, and the header can be reconstructed in full from the other fields
-rw-r--r--src/journal/journald-audit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
index d88d67c5bd..520d1cbb31 100644
--- a/src/journal/journald-audit.c
+++ b/src/journal/journald-audit.c
@@ -354,7 +354,7 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s
if (!p)
return;
- if (sscanf(p, "(%" PRIi64 ".%" PRIi64 ":%" PRIi64 "): %n",
+ if (sscanf(p, "(%" PRIi64 ".%" PRIi64 ":%" PRIi64 "):%n",
&seconds,
&msec,
&id,
@@ -362,6 +362,10 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s
return;
p += k;
+ p += strspn(p, WHITESPACE);
+
+ if (isempty(p))
+ return;
n_iov_allocated = N_IOVEC_META_FIELDS + 5;
iov = new(struct iovec, n_iov_allocated);
@@ -382,7 +386,7 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s
sprintf(id_field, "_AUDIT_ID=%" PRIu64, id);
IOVEC_SET_STRING(iov[n_iov++], id_field);
- m = strappenda("MESSAGE=", data);
+ m = strappenda("MESSAGE=audit: ", p);
IOVEC_SET_STRING(iov[n_iov++], m);
z = n_iov;