router: print error message if invalid routing types (logs/metrics) are set
@@ -214,10 +214,6 @@ int flb_router_io_set(struct flb_config *config)
continue;
}
- if (!flb_router_match_type(i_ins->event_type, o_ins)) {
- continue;
- }
-
if (flb_router_match(i_ins->tag, i_ins->tag_len, o_ins->match
#ifdef FLB_HAVE_REGEX
, o_ins->match_regex
@@ -225,6 +221,26 @@ int flb_router_io_set(struct flb_config *config)
, NULL
#endif
)) {
+
+ if (!flb_router_match_type(i_ins->event_type, o_ins)) {
+ if (i_ins->event_type == FLB_INPUT_LOGS) {
+ flb_error("[router] data generated by %s input are logs, "
+ "but matching destination plugin %s don't handle "
+ "logs",
+ flb_input_name(i_ins),
+ flb_output_name(o_ins));
+ }
+ else if (i_ins->event_type == FLB_INPUT_METRICS) {
+ flb_error("[router] data generated by %s input are metrics, "
+ "but matching destination plugin %s don't handle "
+ "metrics",
+ flb_input_name(i_ins),
+ flb_output_name(o_ins));
+ }
+ continue;
+ }
+
+
flb_debug("[router] match rule %s:%s",
i_ins->name, o_ins->name);
flb_router_connect(i_ins, o_ins);
