diff --git a/modules/kvformat/filterx-func-parse-kv.c b/modules/kvformat/filterx-func-parse-kv.c index 5e8887408..7ad457622 100644 --- a/modules/kvformat/filterx-func-parse-kv.c +++ b/modules/kvformat/filterx-func-parse-kv.c @@ -145,6 +145,15 @@ _generate(FilterXExprGenerator *s, FilterXObject *fillable) return result; } +static FilterXExpr * +_optimize(FilterXExpr *s) +{ + FilterXFunctionParseKV *self = (FilterXFunctionParseKV *) s; + + self->msg = filterx_expr_optimize(self->msg); + return filterx_generator_function_optimize_method(&self->super); +} + static gboolean _init(FilterXExpr *s, GlobalConfig *cfg) { @@ -274,6 +283,7 @@ filterx_function_parse_kv_new(FilterXFunctionArgs *args, GError **error) filterx_generator_function_init_instance(&self->super, "parse_kv"); self->super.super.generate = _generate; self->super.super.create_container = filterx_generator_create_dict_container; + self->super.super.super.optimize = _optimize; self->super.super.super.init = _init; self->super.super.super.deinit = _deinit; self->super.super.super.free_fn = _free;