Go to the documentation of this file.
48 #define MQTT_LOG_PASSWORDS BIT_U32(0)
49 #define MQTT_DEFAULTS (MQTT_LOG_PASSWORDS)
64 MQTTState *state = FlowGetAppState(f);
75 static int JsonMQTTLogger(
ThreadVars *
tv,
void *thread_data,
76 const Packet *p,
Flow *f,
void *state,
void *tx, uint64_t tx_id)
81 if (rs_mqtt_tx_is_toclient((MQTTTransaction*) tx)) {
105 static void OutputMQTTLogDeInitCtxSub(
OutputCtx *output_ctx)
133 if (
unlikely(mqttlog_ctx == NULL)) {
143 output_ctx->
data = mqttlog_ctx;
144 output_ctx->
DeInit = OutputMQTTLogDeInitCtxSub;
146 JsonMQTTLogParseConfig(conf, mqttlog_ctx);
150 result.
ctx = output_ctx;
155 static TmEcode JsonMQTTLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
162 if (initdata == NULL) {
163 SCLogDebug(
"Error getting context for EveLogMQTT. \"initdata\" is NULL.");
175 *data = (
void *)thread;
183 if (thread == NULL) {
194 OutputMQTTLogInitSub,
ALPROTO_MQTT, JsonMQTTLogger, JsonMQTTLogThreadInit,
195 JsonMQTTLogThreadDeinit, NULL);
void FreeEveThreadCtx(OutputJsonThreadCtx *ctx)
int OutputJsonBuilderBuffer(JsonBuilder *js, OutputJsonThreadCtx *ctx)
OutputJsonThreadCtx * CreateEveThreadCtx(ThreadVars *t, OutputJsonCtx *ctx)
OutputJsonThreadCtx * ctx
#define MQTT_LOG_PASSWORDS
int ConfValIsTrue(const char *val)
Check if a value is true.
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.
void JsonMQTTLogRegister(void)
LogMQTTFileCtx * mqttlog_ctx
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
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 LogMQTTLogThread_ LogMQTTLogThread
bool JsonMQTTAddMetadata(const Flow *f, uint64_t tx_id, JsonBuilder *js)
const char * ConfNodeLookupChildValue(const ConfNode *node, const char *name)
Lookup the value of a child configuration node by name.
struct LogMQTTFileCtx_ LogMQTTFileCtx