@@ -461,11 +461,29 @@ engine:
461461# 2. `all_rules`: Captures events when any enabled rule is triggered.
462462#
463463# When a capture starts, Falco records events from the moment the triggering rule
464- # fires until the deadline is reached. The deadline is determined by the rule's
465- # `capture_duration` if specified, otherwise the `default_duration` is used.
466- # If additional rules trigger during an active capture, the deadline is extended
467- # accordingly. Once the deadline expires, the capture stops and data is written
468- # to a file. Subsequent captures create new files with unique names.
464+ # fires until a stop condition is reached. Two stop conditions are available:
465+ #
466+ # - Time (per-rule, soft): determined by the rule's `capture_duration` if
467+ # specified, otherwise `default_duration` is used. If additional rules trigger
468+ # during an active capture, the deadline is extended accordingly (the longest
469+ # deadline wins). For this reason, the time limit has "at least" semantics:
470+ # the capture is guaranteed to last at least that long, but can last longer if
471+ # other rules keep matching.
472+ #
473+ # - File size (global, hard): `max_file_size_mb` applies to any capture,
474+ # regardless of which rule triggered it. Unlike the time limit, it cannot be
475+ # overridden or extended by rules: if a capture reaches this size, it stops.
476+ # N.B. The size check uses the dumper's compressed on-disk counter, which is
477+ # updated in chunks as zlib flushes its internal buffers. The effective file
478+ # size is therefore approximate and may overshoot the configured value by up
479+ # to one flush window. For this reason, avoid very small values (under a few
480+ # MB), which may be inaccurate, and consider tuning with a healthy margin.
481+ #
482+ # The first stop condition met wins (OR semantics). Once a stop condition is
483+ # met, the capture stops and data is written to a file. Subsequent captures
484+ # create new files with unique names. When a capture stops because of
485+ # `max_file_size_mb`, Falco emits an internal INFO message so the truncation
486+ # is visible in the configured outputs.
469487#
470488# Captured data is stored in files with a `.scap` extension, which can be
471489# analyzed later using:
@@ -483,7 +501,8 @@ engine:
483501# Use `capture.mode` to choose between `rules` and `all_rules` modes.
484502#
485503# Set `capture.default_duration` to define the default capture duration
486- # in milliseconds.
504+ # in milliseconds. Optionally, set `capture.max_file_size_mb` to enforce a
505+ # hard upper bound on the capture file size in MB (applies to any capture).
487506#
488507# --- [Suggestions]
489508#
@@ -512,6 +531,10 @@ capture:
512531 mode : rules
513532 # -- Default capture duration in milliseconds if not specified in the rule.
514533 default_duration : 5000
534+ # -- Global hard cap on capture file size in MB (0 = unlimited).
535+ # This limit applies to any capture and cannot be overridden or extended by rules.
536+ # The check is approximate (see the section above): prefer values of at least a few MB.
537+ # max_file_size_mb: 100
515538
516539# ################
517540# Falco plugins #
0 commit comments