suricata
output-json-stats.c File Reference
#include "suricata-common.h"
#include "debug.h"
#include "detect.h"
#include "pkt-var.h"
#include "conf.h"
#include "detect-engine.h"
#include "threads.h"
#include "threadvars.h"
#include "tm-threads.h"
#include "util-print.h"
#include "util-unittest.h"
#include "util-debug.h"
#include "output.h"
#include "util-privs.h"
#include "util-buffer.h"
#include "util-logopenfile.h"
#include "util-crypt.h"
#include "output-json.h"
#include "output-json-stats.h"
Include dependency graph for output-json-stats.c:

Go to the source code of this file.

Data Structures

struct  OutputStatsCtx_
 
struct  JsonStatsLogThread_
 

Macros

#define MODULE_NAME   "JsonStatsLog"
 
#define DEFAULT_LOG_FILENAME   "stats.json"
 

Typedefs

typedef enum OutputEngineInfo_ OutputEngineInfo
 
typedef struct OutputStatsCtx_ OutputStatsCtx
 
typedef struct JsonStatsLogThread_ JsonStatsLogThread
 

Enumerations

enum  OutputEngineInfo_ { OUTPUT_ENGINE_LAST_RELOAD = 0, OUTPUT_ENGINE_RULESET, OUTPUT_ENGINE_ALL }
 

Functions

TmEcode OutputEngineStatsReloadTime (json_t **jdata)
 
TmEcode OutputEngineStatsRuleset (json_t **jdata)
 
json_t * StatsToJSON (const StatsTable *st, uint8_t flags)
 turn StatsTable into a json object More...
 
void JsonStatsLogRegister (void)
 

Variables

bool stats_decoder_events
 
const char * stats_decoder_events_prefix
 

Detailed Description

Author
Tom DeCanio td@np.nosp@m.ulse.nosp@m.tech..nosp@m.com

Implements JSON stats counters logging portion of the engine.

Definition in file output-json-stats.c.

Macro Definition Documentation

#define DEFAULT_LOG_FILENAME   "stats.json"

Definition at line 380 of file output-json-stats.c.

#define MODULE_NAME   "JsonStatsLog"

Definition at line 51 of file output-json-stats.c.

Referenced by JsonStatsLogRegister().

Typedef Documentation

specify which engine info will be printed in stats log. ALL means both last reload and ruleset stats.

Enumeration Type Documentation

specify which engine info will be printed in stats log. ALL means both last reload and ruleset stats.

Enumerator
OUTPUT_ENGINE_LAST_RELOAD 
OUTPUT_ENGINE_RULESET 
OUTPUT_ENGINE_ALL 

Definition at line 60 of file output-json-stats.c.

Function Documentation

void JsonStatsLogRegister ( void  )

Definition at line 526 of file output-json-stats.c.

References LOGGER_JSON_STATS, MODULE_NAME, OutputRegisterStatsModule(), and OutputRegisterStatsSubModule().

Referenced by OutputRegisterLoggers().

Here is the call graph for this function:

Here is the caller graph for this function:

TmEcode OutputEngineStatsReloadTime ( json_t **  jdata)

Definition at line 160 of file output-json-stats.c.

References OUTPUT_ENGINE_LAST_RELOAD.

TmEcode OutputEngineStatsRuleset ( json_t **  jdata)

Definition at line 164 of file output-json-stats.c.

References OUTPUT_ENGINE_ALL, OUTPUT_ENGINE_RULESET, strlcpy(), and TM_ECODE_OK.

Here is the call graph for this function:

Variable Documentation

const char* stats_decoder_events_prefix

Definition at line 54 of file output-json-stats.c.