eve/netflow: add 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 10 months ago committed by Victor Julien
parent db11078315
commit 668c6d646e

@ -3493,6 +3493,9 @@
},
"start": {
"type": "string"
},
"tx_cnt": {
"type": "integer"
}
},
"additionalProperties": false

@ -24,6 +24,7 @@
*/
#include "suricata-common.h"
#include "app-layer-parser.h"
#include "detect.h"
#include "pkt-var.h"
#include "conf.h"
@ -198,6 +199,13 @@ static void NetFlowLogEveToServer(SCJsonBuilder *js, Flow *f)
SCJbSetUint(js, "min_ttl", f->min_ttl_toserver);
SCJbSetUint(js, "max_ttl", f->max_ttl_toserver);
if (f->alstate) {
uint64_t tx_id = AppLayerParserGetTxCnt(f, f->alstate);
if (tx_id) {
SCJbSetUint(js, "tx_cnt", tx_id);
}
}
/* Close netflow. */
SCJbClose(js);
@ -244,6 +252,13 @@ static void NetFlowLogEveToClient(SCJsonBuilder *js, Flow *f)
SCJbSetUint(js, "max_ttl", f->max_ttl_toclient);
}
if (f->alstate) {
uint64_t tx_id = AppLayerParserGetTxCnt(f, f->alstate);
if (tx_id) {
SCJbSetUint(js, "tx_cnt", tx_id);
}
}
/* Close netflow. */
SCJbClose(js);

Loading…
Cancel
Save