Skip to content

Commit

Permalink
filterx: change expr-variable take a name argument
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi committed Apr 10, 2024
1 parent 28f2049 commit 966a022
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/filterx/expr-variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion lib/filterx/expr-variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion lib/filterx/filterx-grammar.ym
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 966a022

Please sign in to comment.