Go to the documentation of this file.
48 #define PGSQL_LOG_PASSWORDS BIT_U32(0)
49 #define PGSQL_DEFAULTS (PGSQL_LOG_PASSWORDS)
67 void *txptr, uint64_t tx_id)
70 SCLogDebug(
"Logging pgsql transaction %" PRIu64
".", tx_id);
92 static void OutputPgsqlLogDeInitCtxSub(
OutputCtx *output_ctx)
101 pgsqllog_ctx->
flags = ~0U;
132 output_ctx->
data = pgsql_ctx;
133 output_ctx->
DeInit = OutputPgsqlLogDeInitCtxSub;
135 JsonPgsqlLogParseConfig(conf, pgsql_ctx);
139 SCLogDebug(
"PostgreSQL log sub-module initialized.");
141 result.
ctx = output_ctx;
146 static TmEcode JsonPgsqlLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
153 if (initdata == NULL) {
154 SCLogDebug(
"Error getting context for EveLogPgsql. \"initdata\" is NULL.");
163 *data = (
void *)thread;
175 if (thread == NULL) {
193 OutputPgsqlLogInitSub,
ALPROTO_PGSQL, JsonPgsqlLogger, JsonPgsqlLogThreadInit,
194 JsonPgsqlLogThreadDeinit);
196 SCLogDebug(
"PostgreSQL JSON logger registered.");
struct SCJsonBuilder SCJsonBuilder
int SCConfValIsTrue(const char *val)
Check if a value is true.
#define PGSQL_LOG_PASSWORDS
void JsonPgsqlLogRegister(void)
void FreeEveThreadCtx(OutputJsonThreadCtx *ctx)
SCJsonBuilder * CreateEveHeader(const Packet *p, enum SCOutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
OutputJsonThreadCtx * CreateEveThreadCtx(ThreadVars *t, OutputJsonCtx *ctx)
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)
void OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, SCJsonBuilder *js, OutputJsonThreadCtx *ctx)
OutputPgsqlCtx * pgsqllog_ctx
const char * SCConfNodeLookupChildValue(const SCConfNode *node, const char *name)
Lookup the value of a child configuration node by name.
OutputJsonThreadCtx * ctx
void SCAppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Per thread variable structure.
struct LogPgsqlLogThread_ LogPgsqlLogThread
void(* DeInit)(struct OutputCtx_ *)
SCConfNode * SCConfGetNode(const char *name)
Get a SCConfNode by name.
struct OutputPgsqlCtx_ OutputPgsqlCtx
bool JsonPgsqlAddMetadata(const void *vtx, void *jb)