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);
93 static void OutputPgsqlLogDeInitCtxSub(
OutputCtx *output_ctx)
102 pgsqllog_ctx->
flags = ~0U;
133 output_ctx->
data = pgsql_ctx;
134 output_ctx->
DeInit = OutputPgsqlLogDeInitCtxSub;
136 JsonPgsqlLogParseConfig(conf, pgsql_ctx);
140 SCLogDebug(
"PostgreSQL log sub-module initialized.");
142 result.
ctx = output_ctx;
147 static TmEcode JsonPgsqlLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
154 if (initdata == NULL) {
155 SCLogDebug(
"Error getting context for EveLogPgsql. \"initdata\" is NULL.");
164 *data = (
void *)thread;
176 if (thread == NULL) {
187 if (
ConfGetNode(
"app-layer.protocols.pgsql") == NULL) {
194 OutputPgsqlLogInitSub,
ALPROTO_PGSQL, JsonPgsqlLogger, JsonPgsqlLogThreadInit,
195 JsonPgsqlLogThreadDeinit);
197 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.
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)
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_ *)
int OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, JsonBuilder *js, OutputJsonThreadCtx *ctx)
struct OutputPgsqlCtx_ OutputPgsqlCtx
const char * ConfNodeLookupChildValue(const ConfNode *node, const char *name)
Lookup the value of a child configuration node by name.