@@ -49,35 +49,29 @@ static void
49
49
log_filterx_pipe_queue (LogPipe * s , LogMessage * msg , const LogPathOptions * path_options )
50
50
{
51
51
LogFilterXPipe * self = (LogFilterXPipe * ) s ;
52
+ FilterXEvalContext eval_context ;
52
53
LogPathOptions local_path_options ;
53
54
gboolean res ;
54
55
55
56
path_options = log_path_options_chain (& local_path_options , path_options );
56
-
57
- FilterXScope * scope = filterx_scope_ref (path_options -> filterx_scope );
58
- if (!scope )
59
- scope = filterx_scope_new ();
60
- filterx_scope_make_writable (& scope );
57
+ filterx_eval_init_context (& eval_context , path_options -> filterx_context );
61
58
62
59
msg_trace (">>>>>> filterx rule evaluation begin" ,
63
60
evt_tag_str ("rule" , self -> name ),
64
61
log_pipe_location_tag (s ),
65
- evt_tag_printf ("path_scope" , "%p" , path_options -> filterx_scope ),
66
- evt_tag_printf ("scope" , "%p" , scope ),
67
62
evt_tag_msg_reference (msg ));
68
63
69
64
NVTable * payload = nv_table_ref (msg -> payload );
70
- res = filterx_eval_exec_statements (scope , self -> stmts , msg );
65
+ res = filterx_eval_exec_statements (& eval_context , self -> stmts , msg );
71
66
72
67
msg_trace ("<<<<<< filterx rule evaluation result" ,
73
68
evt_tag_str ("result" , res ? "matched" : "unmatched" ),
74
69
evt_tag_str ("rule" , self -> name ),
75
70
log_pipe_location_tag (s ),
76
- evt_tag_printf ("scope" , "%p" , scope ),
77
- evt_tag_int ("dirty" , filterx_scope_is_dirty (scope )),
71
+ evt_tag_int ("dirty" , filterx_scope_is_dirty (eval_context .scope )),
78
72
evt_tag_msg_reference (msg ));
79
73
80
- local_path_options .filterx_scope = scope ;
74
+ local_path_options .filterx_context = & eval_context ;
81
75
if (res )
82
76
{
83
77
log_pipe_forward_msg (s , msg , path_options );
@@ -89,7 +83,7 @@ log_filterx_pipe_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_o
89
83
log_msg_drop (msg , path_options , AT_PROCESSED );
90
84
}
91
85
92
- filterx_scope_unref ( scope );
86
+ filterx_eval_deinit_context ( & eval_context );
93
87
nv_table_unref (payload );
94
88
}
95
89
@@ -120,7 +114,7 @@ log_filterx_pipe_new(GList *stmts, GlobalConfig *cfg)
120
114
LogFilterXPipe * self = g_new0 (LogFilterXPipe , 1 );
121
115
122
116
log_pipe_init_instance (& self -> super , cfg );
123
- self -> super .flags = (self -> super .flags | PIF_CONFIG_RELATED ) & ~ PIF_SYNC_SCOPE ;
117
+ self -> super .flags = (self -> super .flags | PIF_CONFIG_RELATED );
124
118
self -> super .init = log_filterx_pipe_init ;
125
119
self -> super .queue = log_filterx_pipe_queue ;
126
120
self -> super .free_fn = log_filterx_pipe_free ;
0 commit comments