return;
}
+static ConfNode *GetConfig(void) {
+ ConfNode *stats = ConfGetNode("stats");
+ if (stats != NULL)
+ return stats;
+
+ ConfNode *root = ConfGetNode("outputs");
+ ConfNode *node = NULL;
+ if (root != NULL) {
+ TAILQ_FOREACH(node, &root->head, next) {
+ if (strcmp(node->val, "stats") == 0) {
+ return node->head.tqh_first;
+ }
+ }
+ }
+ return NULL;
+}
+
/**
* \brief Initializes the output interface context
*
}
memset(sc_perf_op_ctx, 0, sizeof(SCPerfOPIfaceContext));
+ ConfNode *stats = GetConfig();
+ if (stats != NULL) {
+ const char *enabled = ConfNodeLookupChildValue(stats, "enabled");
+ if (enabled != NULL && ConfValIsFalse(enabled)) {
+ sc_counter_enabled = FALSE;
+ SCLogDebug("Stats module has been disabled");
+ SCReturn;
+ }
+ const char *interval = ConfNodeLookupChildValue(stats, "interval");
+ if (interval != NULL)
+ sc_counter_tts = (uint32_t) atoi(interval);
+ }
+
/* Store the engine start time */
time(&sc_start_time);
enabled: no
#filename: custom.socket
+# global stats configuration
+stats:
+ enabled: yes
+ # The interval field (in seconds) controls at what interval
+ # the loggers are invoked.
+ interval: 8
+
# Configure the type of alert (and other) logging you would like.
outputs:
log-packet-header: yes
# Stats.log contains data from various counters of the suricata engine.
- # The interval field (in seconds) tells after how long output will be written
- # on the log file.
- stats:
enabled: yes
filename: stats.log
- interval: 8
# a line based alerts log similar to fast.log into syslog
- syslog: