diff --git a/src/output-droplog.c b/src/output-droplog.c index cf390bc154..4e88186e5a 100644 --- a/src/output-droplog.c +++ b/src/output-droplog.c @@ -212,6 +212,20 @@ static OutputCtx *JsonDropLogInitCtx(ConfNode *conf) return output_ctx; } +static OutputCtx *JsonDropLogInitCtxSub(ConfNode *conf, OutputCtx *parent_ctx) +{ + AlertJsonThread *ajt = parent_ctx->data; + + OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx)); + if (unlikely(output_ctx == NULL)) { + return NULL; + } + + output_ctx->data = ajt->file_ctx; + output_ctx->DeInit = JsonDropLogDeInitCtx; + return output_ctx; +} + /** * \brief Log the dropped packets when engine is running in inline mode * @@ -279,7 +293,6 @@ static int JsonDropLogCondition(ThreadVars *tv, const Packet *p) { return FALSE; } - void TmModuleJsonDropLogRegister (void) { tmm_modules[TMM_JSONDROPLOG].name = MODULE_NAME; tmm_modules[TMM_JSONDROPLOG].ThreadInit = JsonDropLogThreadInit; @@ -288,6 +301,8 @@ void TmModuleJsonDropLogRegister (void) { OutputRegisterPacketModule(MODULE_NAME, "drop-json-log", JsonDropLogInitCtx, JsonDropLogger, JsonDropLogCondition); + OutputRegisterPacketSubModule("eve-log", MODULE_NAME, "drop-json", + JsonDropLogInitCtxSub, JsonDropLogger, JsonDropLogCondition); } #else