From: Juliana Fajardini Date: Wed, 17 Apr 2024 00:29:51 +0000 (-0300) Subject: yaml: unify 0 stats counter config option terms X-Git-Tag: suricata-8.0.0-beta1~1454 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb591240633fe69867991953e3545822e3e658f3;p=thirdparty%2Fsuricata.git yaml: unify 0 stats counter config option terms When we added feature #5976 (72146b969), we overlook that we also have a config stats option for the human-readable stats logs to output 0 counters. Due to not seeing this before, we now have two different setting names for basically the same thing, but in different logs: - zero-valued-counters for EVE - null-values for stats.log This ensures we use the same terminology, and change the recently added one to `null-values`, as this one has been around for longer. Task #6962 --- diff --git a/doc/userguide/output/eve/eve-json-output.rst b/doc/userguide/output/eve/eve-json-output.rst index 4756c042e8..6e1778ed5e 100644 --- a/doc/userguide/output/eve/eve-json-output.rst +++ b/doc/userguide/output/eve/eve-json-output.rst @@ -293,7 +293,7 @@ While the human-friendly `stats.log` output will only log out non-zeroed counters, by default EVE Stats logs output all enabled counters, which may lead to fairly verbose logs. -To reduce log file size, one may set `zero-valued-counters` to false. Do note +To reduce log file size, one may set `null-values` to false. Do note that this may impact on the visibility of information for which a stats counter as zero is relevant. @@ -301,7 +301,7 @@ Config:: - stats: # Don't log stats counters that are zero. Default: true - #zero-valued-counters: false # False will NOT log stats counters: 0 + #null-values: false # False will NOT log stats counters: 0 Date modifiers in filename ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/userguide/partials/eve-log.yaml b/doc/userguide/partials/eve-log.yaml index 685bbf8c48..d71c80b894 100644 --- a/doc/userguide/partials/eve-log.yaml +++ b/doc/userguide/partials/eve-log.yaml @@ -170,7 +170,7 @@ outputs: threads: no # per thread stats deltas: no # include delta values # Don't log stats counters that are zero. Default: true - #zero-valued-counters: false # False will NOT log stats counters: 0 + #null-values: false # False will NOT log stats counters: 0 - dhcp: # DHCP logging. enabled: yes diff --git a/src/output-json-stats.c b/src/output-json-stats.c index 5207ae2d30..d7485d01f9 100644 --- a/src/output-json-stats.c +++ b/src/output-json-stats.c @@ -450,7 +450,7 @@ static OutputInitResult OutputStatsLogInitSub(ConfNode *conf, OutputCtx *parent_ const char *totals = ConfNodeLookupChildValue(conf, "totals"); const char *threads = ConfNodeLookupChildValue(conf, "threads"); const char *deltas = ConfNodeLookupChildValue(conf, "deltas"); - const char *zero_counters = ConfNodeLookupChildValue(conf, "zero-valued-counters"); + const char *zero_counters = ConfNodeLookupChildValue(conf, "null-values"); SCLogDebug("totals %s threads %s deltas %s", totals, threads, deltas); if ((totals != NULL && ConfValIsFalse(totals)) && diff --git a/suricata.yaml.in b/suricata.yaml.in index 28fcac442a..879b389f14 100644 --- a/suricata.yaml.in +++ b/suricata.yaml.in @@ -319,7 +319,7 @@ outputs: threads: no # per thread stats deltas: no # include delta values # Don't log stats counters that are zero. Default: true - #zero-valued-counters: false # False will NOT log stats counters: 0 + #null-values: false # False will NOT log stats counters: 0 # bi-directional flows - flow # uni-directional flows