From 5442adf8f407594d6197e58db492f31048ac4f85 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Mon, 11 Jul 2011 08:37:11 +0200
Subject: support for :omfile: forward compatibility directive
---
doc/log_rotation_fix_size.html | 2 +-
doc/rsyslog_conf_output.html | 2 +-
tools/omfile.c | 10 +++++++++-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/doc/log_rotation_fix_size.html b/doc/log_rotation_fix_size.html
index 190b24cb..51edf033 100644
--- a/doc/log_rotation_fix_size.html
+++ b/doc/log_rotation_fix_size.html
@@ -34,7 +34,7 @@ Channels to achieve this. Putting the following directive
# outchannel definiation
$outchannel log_rotation,/var/log/log_rotation.log, 52428800,/home/me/./log_rotation_script
# activate the channel and log everything to it
-*.* $log_rotation
+*.* :omfile:$log_rotation
# end log rotation via outchannel
diff --git a/doc/rsyslog_conf_output.html b/doc/rsyslog_conf_output.html
index c52aaa5e..426f2f27 100644
--- a/doc/rsyslog_conf_output.html
+++ b/doc/rsyslog_conf_output.html
@@ -49,7 +49,7 @@ does not activate it. To do so, you must use a selector line (see
below). That selector line includes the channel name plus an $ sign in
front of it. A sample might be:
-*.* $mychannel
+*.* :omfile:$mychannel
In its current form, output channels primarily provide the ability to
size-limit an output file. To do so, specify a maximum size. When this
diff --git a/tools/omfile.c b/tools/omfile.c
index 487cf8a0..a4f010c6 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -16,7 +16,7 @@
* pipes. These have been moved to ompipe, to reduced the entanglement
* between the two different functionalities. -- rgerhards
*
- * Copyright 2007-2009 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2007-2011 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of rsyslog.
*
@@ -646,6 +646,14 @@ ENDdoAction
BEGINparseSelectorAct
CODESTARTparseSelectorAct
+ /* Note: the indicator sequence permits us to use '$' to signify
+ * outchannel, what otherwise is not possible due to truely
+ * unresolvable grammar conflicts (*this time no way around*).
+ * rgerhards, 2011-07-09
+ */
+ if(!strncmp((char*) p, ":omfile:", sizeof(":omfile:") - 1)) {
+ p += sizeof(":omfile:") - 1;
+ }
if(!(*p == '$' || *p == '?' || *p == '/' || *p == '.' || *p == '-'))
ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);
--
cgit v1.2.3