Skip to content

Commit

Permalink
Refine rawmsg destination
Browse files Browse the repository at this point in the history
* Refine rawmsg destination to not fire if `RAWMSG` macro is not set or null
  • Loading branch information
Mark Bonsack committed Apr 19, 2020
1 parent f7e143f commit c817b86
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions package/etc/conf.d/destinations/rawmsg_file.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
destination d_rawmsg {
file("/opt/syslog-ng/var/archive/rawmsg/${.splunk.sourcetype}/${HOST}/$YEAR-$MONTH-$DAY-message.log"
template("${RAWMSG}\n")
);
};
channel {
# Test for length of RAWMSG macro contents, minimum (meaning not set) appears to be "2"
filter { "$(length (${RAWMSG}))" != "2" };
destination {
file("/opt/syslog-ng/var/archive/rawmsg/${.splunk.sourcetype}/${HOST}/$YEAR-$MONTH-$DAY-message.log"
template("${RAWMSG}\n")
# template("Length of RAWMSG is: $(length (${RAWMSG})), RAWMSG is: <${RAWMSG}>\n")
);
};
};
};

0 comments on commit c817b86

Please sign in to comment.