#define LOG_STATS_TOTALS (1<<0)
#define LOG_STATS_THREADS (1<<1)
+#define LOG_STATS_NULLS (1<<2)
TmEcode LogStatsLogThreadInit(ThreadVars *, void *, void **);
TmEcode LogStatsLogThreadDeinit(ThreadVars *, void *);
if (st->stats[u].name == NULL)
continue;
+ if (!(aft->statslog_ctx->flags & LOG_STATS_NULLS) && st->stats[u].value == 0)
+ continue;
+
char line[1024];
size_t len = snprintf(line, sizeof(line), "%-25s | %-25s | %-" PRIu64 "\n",
st->stats[u].name, st->stats[u].tm_name, st->stats[u].value);
if (conf != NULL) {
const char *totals = ConfNodeLookupChildValue(conf, "totals");
const char *threads = ConfNodeLookupChildValue(conf, "threads");
+ const char *nulls = ConfNodeLookupChildValue(conf, "null-values");
SCLogDebug("totals %s threads %s", totals, threads);
if (totals != NULL && ConfValIsFalse(totals)) {
if (threads != NULL && ConfValIsTrue(threads)) {
statslog_ctx->flags |= LOG_STATS_THREADS;
}
+ if (nulls != NULL && ConfValIsTrue(nulls)) {
+ statslog_ctx->flags |= LOG_STATS_NULLS;
+ }
SCLogDebug("statslog_ctx->flags %08x", statslog_ctx->flags);
}
filename: stats.log
totals: yes # stats for all threads merged together
threads: no # per thread stats
+ #null-values: yes # print counters that have value 0
# a line based alerts log similar to fast.log into syslog
- syslog: