summaryrefslogtreecommitdiffstats
path: root/runtime/rule.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-07-07 08:22:40 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-07-07 08:22:40 +0200
commit5710b413963d2fde9d062127ed72672b8a58a07e (patch)
tree35cd364e62273da3a239f1c72f1d50d4e69ce21b /runtime/rule.c
parent30f2b5b094d282af6f601aa4e8fa88c1baf187f4 (diff)
downloadrsyslog-5710b413963d2fde9d062127ed72672b8a58a07e.tar.gz
rsyslog-5710b413963d2fde9d062127ed72672b8a58a07e.tar.xz
rsyslog-5710b413963d2fde9d062127ed72672b8a58a07e.zip
milestone/[PARTWORK]: integrted script filter, but var access is missing
Diffstat (limited to 'runtime/rule.c')
-rw-r--r--runtime/rule.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/rule.c b/runtime/rule.c
index 3dcee877..8976c898 100644
--- a/runtime/rule.c
+++ b/runtime/rule.c
@@ -40,6 +40,7 @@
#include "var.h"
#include "srUtils.h"
#include "batch.h"
+#include "parserif.h"
#include "unicode-helper.h"
/* static data */
@@ -186,14 +187,17 @@ shouldProcessThisMessage(rule_t *pRule, msg_t *pMsg, sbool *bProcessMsg)
else
bRet = 1;
} else if(pRule->f_filter_type == FILTER_EXPR) {
+#if 0
CHKiRet(vm.Construct(&pVM));
CHKiRet(vm.ConstructFinalize(pVM));
CHKiRet(vm.SetMsg(pVM, pMsg));
CHKiRet(vm.ExecProg(pVM, pRule->f_filterData.f_expr->pVmprg));
CHKiRet(vm.PopBoolFromStack(pVM, &pResult));
- dbgprintf("result of rainerscript filter evaluation: %lld\n", pResult->val.num);
/* VM is destructed on function exit */
bRet = (pResult->val.num) ? 1 : 0;
+#endif
+ bRet = cnfexprEvalBool(pRule->f_filterData.expr);
+ dbgprintf("result of rainerscript filter evaluation: %d\n", bRet);
} else {
assert(pRule->f_filter_type == FILTER_PROP); /* assert() just in case... */
pszPropVal = MsgGetProp(pMsg, NULL, pRule->f_filterData.prop.propID,
@@ -356,9 +360,11 @@ CODESTARTobjDestruct(rule)
rsCStrRegexDestruct(&pThis->f_filterData.prop.regex_cache);
if(pThis->f_filterData.prop.propName != NULL)
es_deleteStr(pThis->f_filterData.prop.propName);
+#if 0
} else if(pThis->f_filter_type == FILTER_EXPR) {
if(pThis->f_filterData.f_expr != NULL)
expr.Destruct(&pThis->f_filterData.f_expr);
+#endif
}
llDestroy(&pThis->llActList);