diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-19 14:49:57 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-19 14:49:57 +0200 |
commit | 67aebe1d0f21de2426110eae69d36e8be1e792ef (patch) | |
tree | c921e5a52fe89ad329339a8e63954ad34aab485b | |
parent | 708b695283687eb2571e6cc48c9ccb0bc30f9711 (diff) | |
download | rsyslog-67aebe1d0f21de2426110eae69d36e8be1e792ef.tar.gz rsyslog-67aebe1d0f21de2426110eae69d36e8be1e792ef.tar.bz2 rsyslog-67aebe1d0f21de2426110eae69d36e8be1e792ef.zip |
bugfix: omfile action did not respect "template" parameter
... and used default template in all cases
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | tools/omfile.c | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -3,6 +3,8 @@ Version 7.1.4 [devel] 2012-09-?? - implemented ability for CEE-based properties to be stored in disk queues - introduced full JSON support for variable manipulation - introduced "subtree"-type tempalates +- bugfix: omfile action did not respect "template" parameter + ... and used default template in all cases - bugfix: MsgDup() did not copy CEE structure This function was called at various places, most importantly during "last messages repeated n times" processing and omruleset. If CEE(JSON) diff --git a/tools/omfile.c b/tools/omfile.c index 1a36343f..1ccd4a56 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -885,6 +885,7 @@ setInstParamDefaults(instanceData *pData) BEGINnewActInst struct cnfparamvals *pvals; + uchar *tplToUse; int i; CODESTARTnewActInst DBGPRINTF("newActInst (omfile)\n"); @@ -959,7 +960,8 @@ CODESTARTnewActInst ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); } - CHKiRet(OMSRsetEntry(*ppOMSR, 0, ustrdup(getDfltTpl()), OMSR_NO_RQD_TPL_OPTS)); + tplToUse = (pData->tplName == NULL) ? ustrdup(getDfltTpl()) : pData->tplName; + CHKiRet(OMSRsetEntry(*ppOMSR, 0, tplToUse, OMSR_NO_RQD_TPL_OPTS)); if(pData->bDynamicName) { /* "filename" is actually a template name, we need this as string 1. So let's add it |