Go to the documentation of this file.
49 #define PGSQL_LOG_PASSWORDS BIT_U32(0)
62 void *txptr, uint64_t tx_id)
65 SCLogDebug(
"Logging pgsql transaction %" PRIu64
".", tx_id);
73 jb_open_object(jb,
"pgsql");
89 static void OutputPgsqlLogDeInitCtxSub(
OutputCtx *output_ctx)
98 pgsqllog_ctx->
flags = ~0U;
129 output_ctx->
data = pgsql_ctx;
130 output_ctx->
DeInit = OutputPgsqlLogDeInitCtxSub;
132 JsonPgsqlLogParseConfig(conf, pgsql_ctx);
136 SCLogDebug(
"PostgreSQL log sub-module initialized.");
138 result.
ctx = output_ctx;
143 static TmEcode JsonPgsqlLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
150 if (initdata == NULL) {
151 SCLogDebug(
"Error getting context for EveLogPgsql. \"initdata\" is NULL.");
160 *data = (
void *)thread;
172 if (thread == NULL) {
183 if (
ConfGetNode(
"app-layer.protocols.pgsql") == NULL) {
190 OutputPgsqlLogInitSub,
ALPROTO_PGSQL, JsonPgsqlLogger, JsonPgsqlLogThreadInit,
191 JsonPgsqlLogThreadDeinit, NULL);
193 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
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.