summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-07-11 11:24:08 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-07-11 11:24:08 +0200
commit3b63b155ed5e4d58858baa3d6f07293099d8a4e5 (patch)
tree38e8065408eddf7acfdb5172d5a9b364bd436d72
parentb035298e30a5caebbf9dbb7b57ad4e17497b2abf (diff)
parent4e11040e04c7147f9787e2a496591f7ada190480 (diff)
downloadrsyslog-3b63b155ed5e4d58858baa3d6f07293099d8a4e5.tar.gz
rsyslog-3b63b155ed5e4d58858baa3d6f07293099d8a4e5.tar.xz
rsyslog-3b63b155ed5e4d58858baa3d6f07293099d8a4e5.zip
Merge branch 'v5-devel'
Conflicts: ChangeLog configure.ac doc/manual.html runtime/rsyslog.h
-rw-r--r--ChangeLog16
-rw-r--r--doc/log_rotation_fix_size.html2
-rw-r--r--doc/rsyslog_conf_output.html2
-rw-r--r--doc/v4compatibility.html19
-rw-r--r--runtime/conf.c17
-rwxr-xr-xtests/diag.sh4
-rw-r--r--tools/omfile.c17
7 files changed, 57 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 29da56a2..83ec53bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -241,7 +241,12 @@ expected that interfaces, even new ones, break during the initial
syslog plain tcp input plugin (NOT supporting TLS!)
[ported from v4]
---------------------------------------------------------------------------
-Version 5.9.1 [V5-DEVEL] (rgerhards), 2011-06-??
+Version 5.9.2 [V5-DEVEL] (rgerhards), 2011-07-11
+- systemd support: set stdout/stderr to null - thx to Lennart for the patch
+- added support for the ":omusrmsg:" syntax in configuring user messages
+- added support for the ":omfile:" syntax in configuring user messages
+---------------------------------------------------------------------------
+Version 5.9.1 [V5-DEVEL] (rgerhards), 2011-06-30
- added support for obtaining timestamp for kernel message from message
If the kernel time-stamps messages, time is now take from that
timestamp instead of the system time when the message was read. This
@@ -308,9 +313,13 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-06-08
affected directive was: $ActionExecOnlyWhenPreviousIsSuspended on
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236
---------------------------------------------------------------------------
-Version 5.8.3 [V5-stable] (rgerhards), 2011-06-??
+Version 5.8.3 [V5-stable] (rgerhards), 2011-07-11
- systemd support: set stdout/stderr to null - thx to Lennart for the patch
- added support for the ":omusrmsg:" syntax in configuring user messages
+- added support for the ":omfile:" syntax in configuring user messages
+ Note: previous outchannel syntax will generate a warning message. This
+ may be surprising to some users, but it is quite urgent to alert them
+ of the new syntax as v6 can no longer support the previous one.
---------------------------------------------------------------------------
Version 5.8.2 [V5-stable] (rgerhards), 2011-06-21
- bugfix: problems in failover action handling
@@ -1160,8 +1169,9 @@ Version 4.7.0 [v4-devel] (rgerhards), 2010-04-14
Thanks for varmojfekoj for pointing me at this bug.
- imported changes from 4.5.6 and below
---------------------------------------------------------------------------
-Version 4.6.7 [v4-stable] (rgerhards), 2011-06-??
+Version 4.6.7 [v4-stable] (rgerhards), 2011-07-11
- added support for the ":omusrmsg:" syntax in configuring user messages
+- added support for the ":omfile:" syntax in configuring user messages
---------------------------------------------------------------------------
Version 4.6.6 [v4-stable] (rgerhards), 2011-06-24
- bugfix: memory leak in imtcp & subsystems under some circumstances
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</p>
# 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
</pre></p>
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:<br>
<br>
-*.* $mychannel<br>
+*.* :omfile:$mychannel<br>
<br>
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/doc/v4compatibility.html b/doc/v4compatibility.html
index 5d877af1..72b0f5a9 100644
--- a/doc/v4compatibility.html
+++ b/doc/v4compatibility.html
@@ -74,4 +74,23 @@ So it is a good idea to become ready for the new version now and also enjoy some
benefits of the &quot;real restart&quot;, like the better error-reporting capability.
<p>Note that code complexity reduction (and thus performance improvement) needs the restart-type
HUP code to be removed, so these changes can (and will) only happen in version 5.
+<h2>outchannels</h2>
+Note: as always documented, outchannels are an experimental feature that may be
+removed and/or changed in the future.
+There is one concrete change done starting with 4.6.7: let's assume an
+outchannel "mychannel" was defined. Then, this channel could be used inside an
+<code>
+*.* $mychannel
+</code>
+This is still supported and will remain to be supported in v4. However, there is
+a new variant which explicitely tells this is to be handled by omfile. This new
+syntax is as follows:
+<code>
+*.* :omfile:$mychannel
+</code>
+Note that future versions, specifically starting with v6, the older syntax is no
+longer supported. So users are strongly advised to switch to the new syntax. As an
+aid to the conversion process, rsyslog 4.7.4 and above issue a warning message
+if the old-style directive is seen -- but still accept the old syntax without
+any problems.
</body></html>
diff --git a/runtime/conf.c b/runtime/conf.c
index 6a2e57fa..0dd53754 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -653,17 +653,14 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register rule_t *pRule
for (bp=buf; *(bp+1); bp++)
*bp=*(bp+1);
*bp='\0';
- }
- else {
+ } else {
ignorepri = 0;
}
- if ( *buf == '=' )
- {
+ if ( *buf == '=' ) {
singlpri = 1;
pri = decodeSyslogName(&buf[1], syslogPriNames);
}
- else {
- singlpri = 0;
+ else { singlpri = 0;
pri = decodeSyslogName(buf, syslogPriNames);
}
@@ -691,17 +688,13 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register rule_t *pRule
pRule->f_filterData.f_pmask[i] &= ~(1<<pri);
else
pRule->f_filterData.f_pmask[i] |= (1<<pri);
- }
- else
- {
+ } else {
if ( pri == TABLE_ALLPRI ) {
if ( ignorepri )
pRule->f_filterData.f_pmask[i] = TABLE_NOPRI;
else
pRule->f_filterData.f_pmask[i] = TABLE_ALLPRI;
- }
- else
- {
+ } else {
if ( ignorepri )
for (i2= 0; i2 <= pri; ++i2)
pRule->f_filterData.f_pmask[i] &= ~(1<<i2);
diff --git a/tests/diag.sh b/tests/diag.sh
index 1f7de2cf..9fd878a4 100755
--- a/tests/diag.sh
+++ b/tests/diag.sh
@@ -20,7 +20,7 @@ case $1 in
rm -f rsyslogd.started work-*.conf rsyslog.random.data
rm -f rsyslogd2.started work-*.conf
rm -f work rsyslog.out.log rsyslog2.out.log rsyslog.out.log.save # common work files
- rm -rf test-spool test-logdir
+ rm -rf test-spool test-logdir stat-file1
rm -f rsyslog.out.*.log work-presort rsyslog.pipe
rm -f rsyslog.input rsyslog.empty
rm -f core.* vgcore.*
@@ -29,7 +29,7 @@ case $1 in
'exit') rm -f rsyslogd.started work-*.conf diag-common.conf
rm -f rsyslogd2.started diag-common2.conf rsyslog.action.*.include
rm -f work rsyslog.out.log rsyslog2.out.log rsyslog.out.log.save # common work files
- rm -rf test-spool test-logdir
+ rm -rf test-spool test-logdir stat-file1
rm -f rsyslog.out.*.log rsyslog.random.data work-presort rsyslog.pipe
rm -f rsyslog.input rsyslog.conf.tlscert stat-file1 rsyslog.empty
echo -------------------------------------------------------------------------------
diff --git a/tools/omfile.c b/tools/omfile.c
index b50a36ab..4dd32b08 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.
*
@@ -712,6 +712,21 @@ 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;
+ } else {
+ if(*p == '$') {
+ errmsg.LogError(0, RS_RET_OUTDATED_STMT,
+ "action '%s' treated as ':omfile:%s' - please "
+ "change syntax, '%s' will not be supported in "
+ "rsyslog v6 and above.", p, p, p);
+ }
+ }
if(!(*p == '$' || *p == '?' || *p == '/' || *p == '.' || *p == '-'))
ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);