Go to the documentation of this file.
49 #define PGSQL_LOG_PASSWORDS BIT_U32(0)
50 #define PGSQL_DEFAULTS (PGSQL_LOG_PASSWORDS)
68 void *txptr, uint64_t tx_id)
71 SCLogDebug(
"Logging pgsql transaction %" PRIu64
".", tx_id);
79 jb_open_object(jb,
"pgsql");
95 static void OutputPgsqlLogDeInitCtxSub(
OutputCtx *output_ctx)
104 pgsqllog_ctx->
flags = ~0U;
135 output_ctx->
data = pgsql_ctx;
136 output_ctx->
DeInit = OutputPgsqlLogDeInitCtxSub;
138 JsonPgsqlLogParseConfig(conf, pgsql_ctx);
142 SCLogDebug(
"PostgreSQL log sub-module initialized.");
144 result.
ctx = output_ctx;
149 static TmEcode JsonPgsqlLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
156 if (initdata == NULL) {
157 SCLogDebug(
"Error getting context for EveLogPgsql. \"initdata\" is NULL.");
166 *data = (
void *)thread;
178 if (thread == NULL) {
189 if (
ConfGetNode(
"app-layer.protocols.pgsql") == NULL) {
196 OutputPgsqlLogInitSub,
ALPROTO_PGSQL, JsonPgsqlLogger, JsonPgsqlLogThreadInit,
197 JsonPgsqlLogThreadDeinit, NULL);
199 SCLogDebug(
"PostgreSQL JSON logger registered.");
#define PGSQL_LOG_PASSWORDS
void JsonPgsqlLogRegister(void)
void FreeEveThreadCtx(OutputJsonThreadCtx *ctx)
ConfNode * ConfGetNode(const char *name)
Get a ConfNode by name.
int OutputJsonBuilderBuffer(JsonBuilder *js, OutputJsonThreadCtx *ctx)
OutputJsonThreadCtx * CreateEveThreadCtx(ThreadVars *t, OutputJsonCtx *ctx)
OutputPgsqlCtx * pgsqllog_ctx
bool JsonPgsqlAddMetadata(void *vtx, JsonBuilder *jb)
int ConfValIsTrue(const char *val)
Check if a value is true.
OutputJsonThreadCtx * ctx
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
JsonBuilder * CreateEveHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
Per thread variable structure.
struct LogPgsqlLogThread_ LogPgsqlLogThread
void(* DeInit)(struct OutputCtx_ *)
void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
struct OutputPgsqlCtx_ OutputPgsqlCtx
const char * ConfNodeLookupChildValue(const ConfNode *node, const char *name)
Lookup the value of a child configuration node by name.