pub trait PostProcessor: Send + Sync {
// Provided methods
fn process_log(&self, _event: &mut LogEvent) { ... }
fn process_metric(&self, _event: &mut Metric) { ... }
fn process_trace(&self, _event: &mut TraceEvent) { ... }
fn process(&self, event: &mut EventMutRef<'_>) { ... }
}Expand description
A post-processing step applied to every event that flows through a SourceSender.
Implement this trait to mutate events just before they are placed on the output channel. Because each method receives a typed reference, it is impossible at the type level to accidentally change an event’s variant.
It is applied globally — to all outputs (default and named ports) produced by the same
Builder.
Provided Methods§
Sourcefn process_log(&self, _event: &mut LogEvent)
fn process_log(&self, _event: &mut LogEvent)
Called once for every crate::event::LogEvent in a batch.
Sourcefn process_metric(&self, _event: &mut Metric)
fn process_metric(&self, _event: &mut Metric)
Called once for every crate::event::Metric in a batch.
Sourcefn process_trace(&self, _event: &mut TraceEvent)
fn process_trace(&self, _event: &mut TraceEvent)
Called once for every crate::event::TraceEvent in a batch.
Sourcefn process(&self, event: &mut EventMutRef<'_>)
fn process(&self, event: &mut EventMutRef<'_>)
Dispatches a single event to the appropriate typed method.
Override process_log, process_metric, or
process_trace rather than this method unless you need to handle
all variants uniformly.