I added this to my configs

# grep -B 1 -A 1 dyn_ /etc/rsyslog.conf
# custom stats to track in rsyslog
dyn_stats(name="msgs_per_host" resettable="on" maxCardinality="3000" unusedMetricLife="1200") dyn_stats(name="msgs_per_edge_relay" resettable="on" maxCardinality="3000" unusedMetricLife="1200") dyn_stats(name="msgs_per_core_relay" resettable="on" maxCardinality="3000" unusedMetricLife="1200") dyn_stats(name="msgs_per_program" resettable="on" maxCardinality="3000" unusedMetricLife="1200") dyn_stats(name="msgs_per_tag" resettable="on" maxCardinality="3000" unusedMetricLife="1200")

--
  /var/log/sources-messages;sources
  set $.inc = dyn_inc("msgs_per_host", $hostname);
  set $.inc = dyn_inc("msgs_per_program", $programname);
#  if $!trusted!edge!relay != "" then {
#    set $.inc = dyn_inc("msgs_per_edge_relay", $!trusted!edge!relay);
#  }
#  if $!trusted!core!relay != "" then {
#    set $.inc = dyn_inc("msgs_per_edge_relay", $!trusted!core!relay);
#  }
--
    }
    #set $.inc = dyn_inc("msgs_per_tag", $.custommessage);
    /var/log/messages-tags;manual

if I uncomment any of the lines that refer to $! or $. variables, rsyslog basically stops processing messages (a few messages seem to be processed in spurts, bit a lot of processing never happens)

any chance that this has problems with locking around user defined variables?

Also, the documentation doesn't say why we are setting $.inc to the result of the command, what does $.inc contain after the command is run? from the documentation, it looks like it contains an error code (at least the way it's used is similar to error code returns in other languages), but I don't see what the errors are in the doc page.

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to