Skip to content

Commit

Permalink
eve/frame: implement payload-buffer-size option
Browse files Browse the repository at this point in the history
Modeled after the same option in eve/alert. Defaults to 4k.
  • Loading branch information
victorjulien committed Mar 16, 2024
1 parent a5a6527 commit 829bab2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/output-json-frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,22 @@ static OutputInitResult JsonFrameLogInitCtxSub(ConfNode *conf, OutputCtx *parent
goto error;
}

uint32_t payload_buffer_size = 4096;
if (conf != NULL) {
const char *payload_buffer_value = ConfNodeLookupChildValue(conf, "payload-buffer-size");
if (payload_buffer_value != NULL) {
uint32_t value;
if (ParseSizeStringU32(payload_buffer_value, &value) < 0) {
SCLogError("Error parsing payload-buffer-size \"%s\"", payload_buffer_value);
goto error;
}
payload_buffer_size = value;
}
}

json_output_ctx->file_ctx = ajt->file_ctx;
json_output_ctx->eve_ctx = ajt;
json_output_ctx->payload_buffer_size = payload_buffer_size;

output_ctx->data = json_output_ctx;
output_ctx->DeInit = JsonFrameLogDeInitCtxSub;
Expand Down
1 change: 1 addition & 0 deletions suricata.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ outputs:
- frame:
# disabled by default as this is very verbose.
enabled: no
# payload-buffer-size: 4kb # max size of frame payload buffer to output in eve-log
- anomaly:
# Anomaly log records describe unexpected conditions such
# as truncated packets, packets with invalid IP/UDP/TCP
Expand Down

0 comments on commit 829bab2

Please # to comment.