Skip to content
Discussion options

You must be logged in to vote

Suricata has its own cleanup mechanism based on the maxsize setting but it then does some math. The code looks like this:

{%   set maxfiles = (SURICATAMERGED.pcap.maxsize * 1000 / (SURICATAMERGED.pcap.filesize[:-2] | int) / SURICATAMERGED.config['af-packet'].threads | int) | round | int %}
{%   do SURICATAMERGED.config.outputs['pcap-log'].update({'max-files': maxfiles}) %}

Suricata cleans up based on file counts and not size. "max-files" is the number of pcap files per thread to keep. So if you have it set to 100GB in the pillar, pcap.filesize set to 5GB and then threads set to 5, your maxfiles would be set to 4. 5 threads x 4 files that are 5GB is 100GB.

It's not exact and can be tweake…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@cm-ops
Comment options

@alan-lafleur
Comment options

Comment options

You must be logged in to vote
1 reply
@alan-lafleur
Comment options

Answer selected by alan-lafleur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
2.4
Labels
None yet
3 participants