axosyslog
axosyslog copied to clipboard
FilterX failure info
destination oucs {
stdout(template("$a\n"));
};
source incs {
channel {
source { stdin(); network(port(4444)); };
filterx {
# it can be enabled for a subset of messages
failure_info_enable(collect_falsy=true);
};
};
};
log {
source(incs);
log "somethinginternal" {
filterx {
# "somethinginternal" was successful, clear accumulated errors
failure_info_clear();
};
};
log "path1" {
filterx {
# Step #1: abc
failure_info_meta({"step": "#1 abc"});
a = 1;
b = 3;
1 == 1;
true;
# Step #2: cba
failure_info_meta({"step": "#2 cba"});
declare g = 33;
nonexisting.key = g;
};
};
log "path2" {
filterx {
failure_info_meta({"step": "falsystep"});
1 == 0;
true;
};
};
};
# WARNING: must be the last logpath in the config file, or a real fallback path
log "fallback" {
source(incs);
filterx {
$a = failure_info();
};
destination(oucs);
};
added some preliminary notes while this is in draft. this is looking good.
Thank you.
This all looks good. Could we have the testcase in the description here added as a light test? Some test coverage would be very helpful both in terms of QA and also as a documentation how this all can be used.
Other than that, it's an approve from my side.