void riemann_dd_set_field_description(LogDriver *d, LogTemplate *value) { RiemannDestDriver *self = (RiemannDestDriver *)d; self->fields.description = log_template_ref(value); }
void riemann_dd_set_field_service(LogDriver *d, LogTemplate *value) { RiemannDestDriver *self = (RiemannDestDriver *)d; self->fields.service = log_template_ref(value); }
void http_dd_set_body(LogDriver *d, LogTemplate *body) { HTTPDestinationDriver *self = (HTTPDestinationDriver *) d; log_template_unref(self->body_template); self->body_template = log_template_ref(body); }
void redis_dd_set_command(LogDriver *d, const gchar *command, LogTemplate *key, LogTemplate *param1, LogTemplate *param2) { RedisDriver *self = (RedisDriver *)d; g_string_assign(self->command, command); log_template_unref(self->key); self->key = log_template_ref(key); log_template_unref(self->param1); self->param1 = log_template_ref(param1); log_template_unref(self->param2); self->param2 = log_template_ref(param2); }
void synthetic_message_add_value_template(SyntheticMessage *self, const gchar *name, LogTemplate *value) { if (!self->values) self->values = g_ptr_array_new(); /* NOTE: we shouldn't use the name property for LogTemplate structs, see the comment at log_template_set_name() */ log_template_set_name(value, name); g_ptr_array_add(self->values, log_template_ref(value)); }
static LogPipe * log_rewrite_set_clone(LogPipe *s) { LogRewriteSet *self = (LogRewriteSet *) s; LogRewriteSet *cloned; cloned = (LogRewriteSet *) log_rewrite_set_new(log_template_ref(self->value_template)); cloned->super.value_handle = self->super.value_handle; cloned->super.condition = self->super.condition; return &cloned->super.super; }
static LogPipe * log_rewrite_subst_clone(LogPipe *s) { LogRewriteSubst *self = (LogRewriteSubst *) s; LogRewriteSubst *cloned; cloned = (LogRewriteSubst *) log_rewrite_subst_new(log_template_ref(self->replacement)); cloned->matcher = log_matcher_ref(self->matcher); cloned->super.value_handle = self->super.value_handle; cloned->super.condition = self->super.condition; return &cloned->super.super; }
LogRewrite * log_rewrite_set_new(LogTemplate *new_value, GlobalConfig *cfg) { LogRewriteSet *self = g_new0(LogRewriteSet, 1); log_rewrite_init_instance(&self->super, cfg); self->super.super.free_fn = log_rewrite_set_free; self->super.super.clone = log_rewrite_set_clone; self->super.process = log_rewrite_set_process; self->value_template = log_template_ref(new_value); return &self->super; }
static LogPipe * log_rewrite_set_clone(LogPipe *s) { LogRewriteSet *self = (LogRewriteSet *) s; LogRewriteSet *cloned; cloned = (LogRewriteSet *) log_rewrite_set_new(log_template_ref(self->value_template), s->cfg); cloned->super.value_handle = self->super.value_handle; if (self->super.condition) cloned->super.condition = filter_expr_ref(self->super.condition); return &cloned->super.super; }
LogRewrite * log_rewrite_subst_new(LogTemplate *replacement) { LogRewriteSubst *self = g_new0(LogRewriteSubst, 1); log_rewrite_init(&self->super); self->super.super.free_fn = log_rewrite_subst_free; self->super.super.clone = log_rewrite_subst_clone; self->super.process = log_rewrite_subst_process; self->replacement = log_template_ref(replacement); return &self->super; }
static void _replace_template(LogTemplate **old_template, LogTemplate *new_template) { log_template_unref(*old_template); *old_template = log_template_ref(new_template); }