suricata
output-json-stats.c File Reference
#include "suricata-common.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-time.h"
#include "util-unittest.h"
#include "util-validate.h"
#include "util-debug.h"
#include "output.h"
#include "util-privs.h"
#include "util-buffer.h"
#include "util-logopenfile.h"
#include "output-json.h"
#include "output-json-stats.h"
#include "tests/output-json-stats.c"
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"
 

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

◆ 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 501 of file output-json-stats.c.

References LOGGER_JSON_STATS, MODULE_NAME, and OutputRegisterStatsSubModule().

Here is the call 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_NO_ZEROES, JSON_STATS_TOTALS, StatsRecord_::name, StatsTable_::nstats, StatsRecord_::short_name, StatsTable_::start_time, StatsTable_::stats, unlikely, and StatsRecord_::value.