Skip to content

Commit

Permalink
Add in recognition of more complex inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGriggs-TomTom committed May 29, 2020
1 parent 6fadc8c commit 06d7bde
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions syslog_ng_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) error {
stat.value, stat.objectType, stat.id, stat.instance)
}

case "sour":
switch stat.metric {
case "processed":
ch <- prometheus.MustNewConstMetric(e.srcProcessed, prometheus.CounterValue,
stat.value, stat.objectType, stat.id, stat.instance)
}

case "dst.":
switch stat.metric {
case "dropped":
Expand Down

1 comment on commit 06d7bde

@danielgriggs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are cases where some sources are not recognised, I think because the input has a channel inside the source.
For example;
source s_syslog_tcp {
channel {
source {
network( ip("10.66.5.87") port(514) transport("tcp")
tags("syslog_ng", "syslog_tcp", "unprocessed")
flags(dont-store-legacy-msghdr,syslog-protocol)
);
};
rewrite {
set("tcp", value("syslog_transport"));
set("false", value("processed"));
set("${S_UNIXTIME}", value("unixtime"));
};
};
};

The only output from syslog-ng-stats is;

syslog-ng-ctl stats | grep s_syslog_tcp
source;s_syslog_tcp;;a;processed;11428093

Daniel

Please sign in to comment.