From 966a022495cbacdc8d7d5fe4cf99f2515f7a1001 Mon Sep 17 00:00:00 2001 From: Balazs Scheidler Date: Wed, 10 Apr 2024 21:22:06 +0200 Subject: [PATCH] filterx: change expr-variable take a name argument Signed-off-by: Balazs Scheidler --- lib/filterx/expr-variable.c | 4 ++-- lib/filterx/expr-variable.h | 2 +- lib/filterx/filterx-grammar.ym | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/filterx/expr-variable.c b/lib/filterx/expr-variable.c index 0db667e8de9..b1af86da149 100644 --- a/lib/filterx/expr-variable.c +++ b/lib/filterx/expr-variable.c @@ -137,7 +137,7 @@ _unset(FilterXExpr *s) } FilterXExpr * -filterx_variable_expr_new(NVHandle handle) +filterx_variable_expr_new(const gchar *name) { FilterXVariableExpr *self = g_new0(FilterXVariableExpr, 1); @@ -147,6 +147,6 @@ filterx_variable_expr_new(NVHandle handle) self->super.assign = _assign; self->super.isset = _isset; self->super.unset = _unset; - self->handle = handle; + self->handle = log_msg_get_value_handle(name); return &self->super; } diff --git a/lib/filterx/expr-variable.h b/lib/filterx/expr-variable.h index 14a37e66050..4252ca80f6d 100644 --- a/lib/filterx/expr-variable.h +++ b/lib/filterx/expr-variable.h @@ -25,6 +25,6 @@ #include "filterx/filterx-expr.h" -FilterXExpr *filterx_variable_expr_new(NVHandle handle); +FilterXExpr *filterx_variable_expr_new(const gchar *name); #endif diff --git a/lib/filterx/filterx-grammar.ym b/lib/filterx/filterx-grammar.ym index d975ffa04d8..450f5ca0dd6 100644 --- a/lib/filterx/filterx-grammar.ym +++ b/lib/filterx/filterx-grammar.ym @@ -66,7 +66,8 @@ construct_template_expr(LogTemplate *template) filterx_config_freeze_object(configuration, filterx_string_new(log_template_get_literal_value(template, NULL), -1))); else if (log_template_is_trivial(template)) - result = filterx_variable_expr_new(log_template_get_trivial_value_handle(template)); + result = filterx_variable_expr_new( + log_msg_get_value_name(log_template_get_trivial_value_handle(template))); else result = filterx_template_new(log_template_ref(template)); log_template_unref(template);