Security Onion log retention with DLM, ILM and disk watermarks

Security Onion retention is set by one method choice plus disk and PCAP limits. Plan them together so logs age out on your schedule instead of stopping ingest when disks fill.

On this page

How Security Onion log retention with DLM and ILM works

Security Onion keeps logs for as long as its retention method allows, and that method is set in one place: data_retention_method under Administration > Configuration > Elasticsearch. If your grid is filling disks and an analyst asks how far back they can search, the answer depends on which lifecycle approach the grid uses, how much space the search nodes have, and whether the disk watermarks are set to stop ingest before the disks fill. Data stream lifecycle (DLM) and index lifecycle management (ILM) are the two approaches Security Onion offers. Separately, full packet capture (PCAP) retention is bounded by its own limit, maxsize, which caps the total gigabytes all PCAP files may use. Log retention and PCAP retention must be planned as two different numbers.

The choice between DLM and ILM changes who deletes data and what happens when storage runs short. Under DLM, the Elasticsearch docs note that the so-elasticsearch-indices-delete script is disabled, so the lifecycle policy of the data stream takes over deletion. Reaching the disk watermarks can also stop ingest, which means a full disk shows up as missing events rather than as an old index being removed. Before you switch methods, confirm with your Security Onion documentation and your search node sizing how each method behaves on your version, and test the switch on a non-production grid if you can. Changing the method on a grid that already holds data is a decision to make deliberately, not a setting to toggle during an incident.

Plan retention at three points: before go-live, after any storage change such as adding a search node or resizing a volume, and at each compliance review. Before go-live, record the required searchable history for analysts and the PCAP window you need for investigations, then size storage against both. After a storage change, recheck the watermarks, because a larger disk changes how much history fits before ingest stops. At compliance review, show which method is active, what it deletes, and how PCAP size is capped. Ask your Security Onion contact to confirm the exact behavior of each setting for your release before you write these answers into a policy.

Choosing between data stream lifecycle and ILM

DLM is the retention path Security Onion sets up as its managed default for Elasticsearch data streams. Retention is expressed as an age-based rule on each data stream, and Elasticsearch applies it on its own schedule, so you do not need a separate policy engine to delete old data. The trade-off is that DLM works on data streams only, and you give up some of the fine-grained phase control that ILM offers. Under DLM, the so-elasticsearch-indices-delete script is disabled, so the retention you configure is the retention that runs.

  • Deletion driver: Data is removed by age rules on each data stream, not by a script on a cron-style schedule.
  • Script status: so-elasticsearch-indices-delete is disabled, so a custom deletion change made outside the configured method will not take effect.
  • Watermark risk: If disk usage reaches the watermarks before age rules remove enough data, ingest can stop. Size pressure is not handled by age alone.
  • Operator effort: Less to maintain day to day, with fewer moving parts in the retention path.
  • Limit to confirm: Verify which indices your grid creates as data streams before assuming DLM covers all of them.

Before you choose DLM, confirm in your Security Onion version and in the Elasticsearch documentation for it that data stream lifecycle behaves as described for your indices, and test retention on a non-production grid.

Retention settings and when each fits

This table compares the retention settings Security Onion exposes for Elasticsearch data and PCAP, and what each one means for when data is deleted or ingest stops. Read each row as a decision: find the setting, check the trade-off, then confirm the behavior in your own build before you rely on it.

SettingWhat it doesWhen it fits and the trade-off
data_retention_method set to DLMElasticsearch data stream lifecycle manages how long indexed data stays. Selected under Administration > Configuration > Elasticsearch.Fits grids that want the lifecycle handled by Elasticsearch's data stream mechanism. Confirm the retention periods your version applies and how they map to your storage plan before go-live.
data_retention_method set to ILMIndex lifecycle management manages index phases and deletion. Selected under Administration > Configuration > Elasticsearch.Fits teams that want lifecycle policy expressed through index phases. Confirm how switching methods on an existing grid affects indices already present, since the change is not a simple toggle.
so-elasticsearch-indices-delete script under DLMThe script that deletes old indices is disabled when DLM is the active method.Deletion is handled by the lifecycle policy instead of the script. If you expect the script to clean up old data, you will be disappointed. Confirm the deletion behavior in your version's documentation.
Disk watermarksWhen Elasticsearch reaches its disk watermarks, ingest can stop.Protects nodes from filling their disks, but a full stop halts collection of new logs. Size storage with headroom, alert on disk use, and confirm the watermark thresholds your build uses.
maxsize for Suricata PCAPCaps the total GB that all PCAP files may use.Gives a predictable ceiling for packet storage, but older captures are lost once the cap is reached. Choose the value from your incident response window and available disk, and confirm how capture rotates at the limit.
PCAP lz4 compression, levels 0 to 16Optional lz4 compression of PCAP files, with levels from 0 to 16.Compression lets the same maxsize hold more capture time at the cost of CPU on the sensor. Test the level on representative traffic before you set it, because higher levels use more processing.
Per-data-type retentionNetwork metadata, alerts, case data and PCAP can be governed separately.Keeping PCAP short while metadata lasts longer is a common split. Confirm which index families each method covers, and that case and Kibana data are not removed by the same policy.

Switching retention methods without losing data

This sequence changes how Security Onion expires old Elasticsearch data while keeping ingest running and the existing indices intact. It ends with a recorded baseline, a confirmed retention method and evidence that new data is still arriving.

  1. Record current retention and disk use

    Before changing anything, the Security Onion administrator records the active retention method, the configured retention periods, the disk usage on each search and heavy node, and the total size of the Elasticsearch data. Save the Configuration values and a screenshot or export of disk usage in your change record. The step is done when you can state the current method and the free disk percentage on every data node, so you have a baseline to compare against after the switch. Also record which node currently holds the most data, because that node reaches its watermarks first.

  2. Review the Elasticsearch configuration page

    Open Administration, then Configuration, then Elasticsearch in the Security Onion Console and read the data_retention_method setting along with every retention value it controls. Confirm which method is active and whether any local overrides exist that could conflict with the change. Check the watermark-related values as well so you know at what disk level ingest will stop. The step is done when you have written down the target method and the values that will change, and you have confirmed that no other team member is editing the same configuration.

  3. Choose the retention method

    Select the method that matches how your organization wants data to expire. Data stream lifecycle (DLM) and index lifecycle management (ILM) use different rules for rollover and deletion, so the choice should follow your storage limits and your review of the Elasticsearch documentation. Confirm the method with the team that owns evidence retention, and get the decision recorded with the target retention periods. The step is done when the chosen method and its retention periods appear in your change record and have a named approver.

  4. Apply the change through the Console

    Set data_retention_method in the Elasticsearch configuration page in the Console and save the change, then let the grid apply the configuration. Do this during a window where analysts are not running large searches, and keep the baseline open for comparison. The step is done when the Console shows the new method as active and the change appears in the configuration history with your user name.

  5. Confirm the deletion script state

    Under DLM, the so-elasticsearch-indices-delete script is disabled, so confirm that it is disabled when DLM is selected and that it is not running under ILM. Check the state from the manager node and compare it with your baseline. If the script state does not match the method you chose, stop and resolve it before continuing, because a mismatch can cause data to be deleted under the wrong rules or kept indefinitely. The step is done when the script state matches the selected method and you have recorded the output.

  6. Check index ages and disk headroom

    Review the age of the oldest indices and confirm that they are being handled under the new method, not deleted all at once. Compare disk usage on each data node against the baseline, and confirm that no node is approaching its watermark. Under DLM, size-based deletion behavior depends on your configured limits, so verify that the limits leave enough room for new data. The step is done when index ages, disk headroom and retention periods agree with the target values in your change record.

  7. Verify ingest keeps running

    Confirm that new events from sensors and agents are still arriving in Security Onion after the change. Run a short search for events from the last few minutes, and check the Grid page for node status and event rates. Watch for ingest stopping at a watermark or for errors in the Elasticsearch health checks. The step is done when recent data from each sensor type is visible and the event rate matches the baseline. If ingest stops, roll back by restoring the previous data_retention_method value in the Console, verify ingest again, and escalate before retrying.

How disk watermarks can stop ingest

Elasticsearch disk watermarks decide what happens to a search node as its storage fills. When a node crosses the thresholds, Elasticsearch stops allocating new shards to it, and at the highest level it blocks writes to indices with shards on that node. For a Security Onion grid, that means new network and endpoint events can back up or be refused until space is freed. Retention is the control that frees space, so deletion has to keep pace with ingest. A retention setting that looks correct on paper can still fail if daily volume grows faster than the window it keeps. Under the DLM method, the so-elasticsearch-indices-delete script is disabled, so Elasticsearch lifecycle rules are what free space and nothing else does.

Planning starts with three numbers you can measure in your own environment: the usable disk on each search node, the daily ingest volume per data stream, and the retention period you need for investigations and compliance. Multiply daily ingest by the retention period, add headroom for replicas, merges and the growth you expect over the next year, then compare the result with usable disk on each search node. Confirm with your Security Onion team how replicas are configured on your grid, because they change the footprint. Check current volume on the Grid page and in Elasticsearch itself before you choose a retention period, not after the first watermark incident.

Alert before any watermark is reached. Set monitoring on free disk per search node and on index growth rate, so you see a trend days before a threshold is crossed. Route those alerts to the people who can change retention or add storage, and document the response, since a watermark breach can stop ingest without any obvious error on the analyst side. Confirm the exact watermark values and alerting options for your Elasticsearch version in the Security Onion Elasticsearch docs before you set thresholds, and test that an alert fires before ingest is affected.

Security and operational risks in retention changes

Changing how long Security Onion keeps data affects investigations, recovery and the search nodes that hold the data. The cards below cover the risks to check before you change the retention method, shorten a window or rely on backups for evidence.

Evidence and legal hold before deletion

Retention rules delete indices on a schedule, so a shorter window can remove alerts, logs or PCAP that an open case or legal hold still needs. Before you change the setting, list which investigations, regulators or counsel require preservation and confirm the data they need is either copied out or exempt from the new window. Record that decision with the change so the reason survives staff turnover.

Who may change retention and audit trail

Retention is set under Administration > Configuration > Elasticsearch, so anyone with access to that screen can shorten how long evidence lives. Limit who holds the permission, require a ticket for each change and keep a dated record of the old and new values. Confirm how your grid logs configuration changes, since a silent edit can be discovered only after data is gone.

Data loss from shortened windows

Lowering a window does not only affect new data. Once the lifecycle policy runs, older indices that fall outside the new window are removed and cannot be recovered from the grid itself. Test the change on a non-production grid first, check which indices would qualify, and confirm that the analysts who rely on historical hunting have agreed to the shorter period.

Disk pressure on search nodes

When data is kept longer than disk capacity allows, Elasticsearch disk watermarks can stop ingest, and under data retention method DLM the so-elasticsearch-indices-delete script is disabled, so the grid will not clear space on its own. Size each search node for the retention you need plus headroom, and watch disk usage on the Grid page so you see pressure before ingest stops.

Elasticsearch docs

Interaction with backups and snapshots

Retention deletes data from the live cluster, while Elasticsearch snapshots and file backups are separate copies with their own schedules. A snapshot taken before a deletion may be the only surviving copy of a case, so know which snapshots exist, how long they are kept and where they are stored. Confirm that a deleted index can still be restored from a snapshot before you rely on that path.

Access to retained PCAP

Suricata PCAP retention is bounded by maxsize, the total GB all PCAP files may use, so older packet captures are overwritten as new traffic arrives. Lowering maxsize shortens how far back packets can be examined, even when log retention is unchanged. Review who can open packet data, since captures can expose credentials and personal data, and document that access alongside the retention setting.

Full packet capture docs

Questions teams ask before changing log retention

How long should Security Onion keep logs?

There is no universal number. The right retention period comes from the investigation window your analysts need, the reporting periods your regulators or contracts require, and the disk you can dedicate to indexed data on your search nodes. Start by listing each data type (Zeek and Suricata metadata, alerts, Windows and firewall logs, and PCAP) and the lookback each one needs. Then size storage against your measured daily ingest, leaving headroom below the disk watermarks. Confirm the retention requirement with your compliance owner in writing before you set a value in the Console.

Can our own team change Security Onion retention without a partner?

Yes, if your team is comfortable with Linux administration, Elasticsearch index lifecycle concepts and the Security Onion Console. The setting itself is made under Administration > Configuration > Elasticsearch, using data_retention_method. The harder part is verifying the change: confirming which method is active, checking that old data is removed as expected, and watching disk usage on every search node after the change. Teams without an Elasticsearch operator on staff usually test the change on a non-production grid first and document the rollback steps before touching production.

What skills and effort does a retention change need?

The work needs someone who can read Elasticsearch health and disk output, a Security Onion administrator who knows the grid layout, and a change owner who can sign off on retention periods. Effort is mostly planning and verification rather than the configuration change itself. Expect to review current disk use per node, confirm the retention method, test deletion behavior on a copy of the grid if one exists, and record the outcome. Ask your team to confirm the Security Onion version in use first, because retention steps depend on the release line you run.

What makes a retention project take more effort?

Four factors drive effort most. Grid size matters because each search node has its own disk and watermark behavior to check. Ingest volume matters because a higher daily rate fills disks faster, which shortens the safe window. Compliance rules matter because they may set minimum retention periods and require evidence of deletion. The number of PCAP capture points matters because PCAP retention is bounded by the maxsize setting, so each sensor needs its own sizing. A grid with many nodes, high traffic and strict retention rules takes longer to plan and test than a small standalone install.

Is a partner worth it for log retention work?

A partner is worth considering when the change touches a production grid that analysts rely on, when retention periods are set by regulation, or when your team lacks time to test rollback. A partner can plan the retention model, test the change, check watermark behavior under load and write the operating runbook. The trade-off is cost against the risk of an unplanned ingest stop. DeployOpen plans, implements, documents and supports self-hosted open-source platforms in infrastructure you control, so the work stays inside your environment.

What does a fixed-scope retention quote need to include?

A useful quote starts from a written scope. Ask for the grid topology you want covered, the retention periods by data type, the retention method to be set, the PCAP maxsize values per sensor, the testing approach and the rollback plan. Ask for the deliverables in writing, such as the configuration record, the verification results and the operating runbook, and for a list of what is excluded. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and most engagements are fixed-scope. Ask for a quote only after your scope is written, so the price reflects the work you actually need.

Does DLM or ILM change which logs are deleted first?

Both methods delete data by age, but the mechanics differ, so confirm the behavior on your version before relying on either. Under DLM, the so-elasticsearch-indices-delete script is disabled, so Security Onion does not run the older index deletion path. Reaching the disk watermarks can stop ingest, which is the failure to plan for regardless of method. Check the current Elasticsearch documentation and the Security Onion Elasticsearch page for the exact behavior of your release, and test a switch before applying it to production.

How retention, watermarks and PCAP limits fit together

The diagram starts with events arriving from sensors and Elastic Fleet agents and landing in Elasticsearch data streams. The retention method you choose under Administration > Configuration > Elasticsearch determines what deletes aged indices, and disk watermarks sit alongside that deletion path as the point where ingest can stop. Suricata full packet capture follows a separate branch bounded by maxsize, so PCAP retention is set on its own and does not depend on the log lifecycle. Check each branch in its own settings before you assume a limit applies to the other.

Log lifecycle, disk watermarks and PCAP limits as separate controls.

How DeployOpen plans retention for your grid

DeployOpen plans Security Onion log retention as a written scope inside your own infrastructure, starting from how long each data type must stay searchable and how much disk each node has. The retention method, delete behavior, watermark thresholds and PCAP limits are agreed and tested before anything is changed on a production grid.

How we scope

  • Engagements are fixed-scope, with retention periods, data types and deliverables agreed in writing before work starts.
  • We record the current data_retention_method and how each node's disk is shared between logs and PCAP.
  • We confirm which teams need searchable history, and for how long, before choosing DLM or ILM settings.
  • Quotes follow from the written scope, so the retention work is priced against the nodes and data types you name.

How we build

  • We plan the change window for switching retention methods, since DLM disables the so-elasticsearch-indices-delete script.
  • We set disk watermark thresholds with the ingest impact on each search node reviewed before they go live.
  • We size maxsize for PCAP on each sensor so capture limits match the disk budget agreed in scope.
  • We test deletion and watermark behavior on a non-production grid where your environment allows it.

How we hand over

  • You receive a written retention record listing the method, periods, watermarks and maxsize values per node.
  • The runbook explains how to check disk pressure and what happens when a watermark stops ingest.
  • We document how to confirm the change is applied through Salt-managed configuration on your grid.
  • Your team walks through the handover, with questions on retention decisions answered before we close.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial retention work.
  • A retainer can cover periodic review of disk growth, watermark thresholds and PCAP usage as traffic changes.
  • Retention settings are rechecked when Security Onion versions change, since upgrade paths differ by release and distribution.
  • Where your auditors need evidence of retention controls, we prepare the configuration records but auditors issue any opinion.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.