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

◆ DEFAULT_LOG_FILENAME

#define DEFAULT_LOG_FILENAME   "stats.json"

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

◆ MODULE_NAME

#define MODULE_NAME   "JsonStatsLog"

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

Typedef Documentation

◆ JsonStatsLogThread

◆ OutputEngineInfo

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

◆ OutputStatsCtx

Enumeration Type Documentation

◆ OutputEngineInfo_

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

◆ JsonStatsLogRegister()

void JsonStatsLogRegister ( void  )

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

References LOGGER_JSON_STATS, MODULE_NAME, and OutputRegisterStatsModule().

Referenced by OutputRegisterLoggers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OutputEngineStatsReloadTime()

TmEcode OutputEngineStatsReloadTime ( json_t **  jdata)

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

◆ OutputEngineStatsRuleset()

TmEcode OutputEngineStatsRuleset ( json_t **  jdata)

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

◆ StatsToJSON()

json_t* StatsToJSON ( const StatsTable st,
uint8_t  flags 
)

turn StatsTable into a json object

Parameters
flagsJSON_STATS_* flags for controlling output

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

References flags, JSON_STATS_TOTALS, StatsRecord_::name, StatsTable_::nstats, StatsTable_::start_time, StatsTable_::stats, and unlikely.