axosyslog icon indicating copy to clipboard operation
axosyslog copied to clipboard

FilterX failure info

Open MrAnno opened this issue 7 months ago • 3 comments

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);
};

MrAnno avatar May 21 '25 10:05 MrAnno

added some preliminary notes while this is in draft. this is looking good.

bazsi avatar May 22 '25 09:05 bazsi

Thank you.

MrAnno avatar May 22 '25 12:05 MrAnno

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.

bazsi avatar May 22 '25 14:05 bazsi