Skip to content

Commit

Permalink
yaml: unify 0 stats counter config option terms
Browse files Browse the repository at this point in the history
When we added feature OISF#5976 (72146b9), 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 OISF#6962
  • Loading branch information
jufajardini authored and victorjulien committed Apr 19, 2024
1 parent d335455 commit bb59124
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/userguide/output/eve/eve-json-output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ 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.

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
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/userguide/partials/eve-log.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/output-json-stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) &&
Expand Down
2 changes: 1 addition & 1 deletion suricata.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb59124

Please sign in to comment.