]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
drop-json: make child of eve-log
authorVictor Julien <victor@inliniac.net>
Thu, 30 Jan 2014 09:50:38 +0000 (10:50 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 30 Jan 2014 09:51:26 +0000 (10:51 +0100)
Make drop json child of eve-log.

src/output-droplog.c

index cf390bc154e2d1cd01ba3f3d79db09d06f65aca4..4e88186e5a911f542b59c0a345d390594da94c1e 100644 (file)
@@ -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