Go to the documentation of this file.
48 #define MQTT_LOG_PASSWORDS BIT_U32(0)
49 #define MQTT_DEFAULT_FLAGS (MQTT_LOG_PASSWORDS)
50 #define MQTT_DEFAULT_MAXLOGLEN 1024
68 static int JsonMQTTLogger(
ThreadVars *
tv,
void *thread_data,
69 const Packet *p,
Flow *f,
void *state,
void *tx, uint64_t tx_id)
74 if (rs_mqtt_tx_is_toclient((MQTTTransaction*) tx)) {
98 static void OutputMQTTLogDeInitCtxSub(
OutputCtx *output_ctx)
121 SCLogError(
"Error parsing string-log-limit from config - %s, ", query);
135 if (
unlikely(mqttlog_ctx == NULL)) {
145 output_ctx->
data = mqttlog_ctx;
146 output_ctx->
DeInit = OutputMQTTLogDeInitCtxSub;
148 JsonMQTTLogParseConfig(conf, mqttlog_ctx);
152 result.
ctx = output_ctx;
157 static TmEcode JsonMQTTLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
164 if (initdata == NULL) {
165 SCLogDebug(
"Error getting context for EveLogMQTT. \"initdata\" is NULL.");
177 *data = (
void *)thread;
185 if (thread == NULL) {
196 OutputMQTTLogInitSub,
ALPROTO_MQTT, JsonMQTTLogger, JsonMQTTLogThreadInit,
197 JsonMQTTLogThreadDeinit);
void FreeEveThreadCtx(OutputJsonThreadCtx *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)
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
#define MQTT_DEFAULT_FLAGS
void(* DeInit)(struct OutputCtx_ *)
int OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, JsonBuilder *js, OutputJsonThreadCtx *ctx)
int ParseSizeStringU32(const char *size, uint32_t *res)
#define SCLogError(...)
Macro used to log ERROR messages.
bool JsonMQTTAddMetadata(void *vtx, JsonBuilder *js)
struct LogMQTTLogThread_ LogMQTTLogThread
#define MQTT_DEFAULT_MAXLOGLEN
const char * ConfNodeLookupChildValue(const ConfNode *node, const char *name)
Lookup the value of a child configuration node by name.
struct LogMQTTFileCtx_ LogMQTTFileCtx