eve/flow: log tx_cnt

This patch adds a `tx_cnt` field to `netflow` events to give some
context about the underlying protocol activity.

Ticket: #7635
pull/13044/head
Eric Leblond 6 months ago committed by Victor Julien
parent 668c6d646e
commit 5cf6459f3f

@ -1982,6 +1982,9 @@
},
"wrong_thread": {
"type": "boolean"
},
"tx_cnt": {
"type": "integer"
}
},
"additionalProperties": false

@ -27,6 +27,7 @@
#include "detect.h"
#include "pkt-var.h"
#include "conf.h"
#include "app-layer-parser.h"
#include "threads.h"
#include "threadvars.h"
@ -350,6 +351,13 @@ static void EveFlowLogJSON(OutputJsonThreadCtx *aft, SCJsonBuilder *jb, Flow *f)
SCJbClose(jb); /* close array */
}
if (f->alstate) {
uint64_t tx_id = AppLayerParserGetTxCnt(f, f->alstate);
if (tx_id) {
SCJbSetUint(jb, "tx_cnt", tx_id);
}
}
/* Close flow. */
SCJbClose(jb);

Loading…
Cancel
Save