]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stats: fix stats.log ignoring null-values for threads
authorVictor Julien <victor@inliniac.net>
Mon, 2 May 2016 12:30:35 +0000 (14:30 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 2 May 2016 12:30:35 +0000 (14:30 +0200)
src/log-stats.c

index e08c6888cdedc8a99ee8dc60c2438748d7c302e7..a02e4a1225a3d6471333eb639ba16db72d26c023 100644 (file)
@@ -138,6 +138,9 @@ int LogStatsLogger(ThreadVars *tv, void *thread_data, const StatsTable *st)
                 if (st->tstats[u].name == NULL)
                     continue;
 
+                if (!(aft->statslog_ctx->flags & LOG_STATS_NULLS) && st->tstats[u].value == 0)
+                    continue;
+
                 char line[256];
                 size_t len = snprintf(line, sizeof(line), "%-42s | %-25s | %-" PRIu64 "\n",
                         st->tstats[u].name, st->tstats[u].tm_name, st->tstats[u].value);