← All posts

Logging Concepts: Configuration, Time Sync, Ingestion, Integrity and Retention

27 Nov 2026

Logs are the security team’s memory. When something goes wrong, they are often the only witness that saw it happen: who logged in, which process started, which IP talked to which server, and when. But a log is only useful if four things are true. It was collected, it contains the right detail, nobody tampered with it, and it is still there when you need it.

Five concepts make those things true. This article walks through each of them, in the order a log lives through them, from the moment an event is written to the day it is deleted:

  1. Configuration: deciding what to log and in how much detail
  2. Time synchronization: making every clock agree before anything is written
  3. Ingestion: getting logs from everywhere into one place
  4. Integrity and security: proving logs are complete and unaltered
  5. Retention: keeping logs long enough, and not forever
Configuration

The settings on each system that decide which events get written to a log and in how much detail. If something is not configured to be logged, no later step can recover it.

1 Sources
  • endpoints
  • servers
  • network
  • cloud

Everything that produces logs: laptops and servers, firewalls and routers, cloud accounts (AWS, Azure) and applications. Each one records what happens on it.

2 Ingest
  • agents
  • syslog
  • WEF
  • cloud APIs

Collecting those logs and moving them to one central place, using small programs on each machine (agents), the standard syslog protocol, Windows Event Forwarding (WEF, built into Windows) or cloud APIs.

3 Normalize
  • parse
  • map fields
  • enrich

Every product writes logs differently. Normalizing turns each one into the same named fields (time, user, IP, action) so they can be searched together, and adds context such as the IP address's country.

4 Analyze
  • SIEM search
  • correlate
  • alert

A SIEM (Security Information and Event Management) system searches all logs at once, links related events from different systems and raises an alert when something looks like an attack.

5 Retain
  • hot
  • warm
  • cold
  • archive
  • delete

Keeping logs for a set time: recent ones on fast storage, older ones on cheaper and slower storage, then deleting them securely when the retention policy says so.

applies to every step
Time sync

All devices take their time from the same source using NTP (Network Time Protocol) and record it in UTC, one worldwide time zone, so events from different systems line up in the right order.

Integrity

Logs are encrypted in transit with TLS, only a few people can access them, hashes act as fingerprints that reveal any change, and storage is set so entries cannot be edited or deleted.

Keep this picture in mind. Every section below zooms into one part of it.


1. Configuration: deciding what to log

What it means

Logging configuration is how you decide what gets recorded, how much detail each record has, and where it goes. The most expensive SIEM (the central system that collects and analyzes logs, covered in section 3) is useless if the server never wrote the event in the first place. Many breach investigations end with the sentence “logging was not enabled”.

A useful mindset: log for the questions you will need to answer. During an incident you will ask who did it, what did they do, when, from where, to what, and did it succeed? Every important log record should answer those six questions.

Logging levels (severity)

Most systems let you choose a logging level. Syslog defines eight severities, from 0 (most severe) to 7 (least):

  1. 0 Emergency system is unusable
  2. 1 Alert act immediately (e.g. database corrupted)
  3. 2 Critical hardware or component failure
  4. 3 Error operation failed (service crashed)
  5. 4 Warning might become a problem (disk 90% full)
  6. 5 Notice normal but significant (config change)
  7. 6 Informational routine events (user logged in)
  8. 7 Debug developer detail for troubleshooting
act on these fast typical production range: up to 6 temporary troubleshooting only
Setting a level means 'this level and everything more severe'. Level 6 on a device logs 0 to 6. Debug can multiply volume many times over, so enable it briefly and on purpose. Bar lengths are illustrative.

Setting a device to a level means log this level and everything more severe. A firewall set to level 4 (Warning) records levels 0 through 4, and ignores Notice, Informational and Debug.

A handy mnemonic for the order 0 to 7: Every Awesome Cisco Engineer Will Need Ice cream Daily (Emergency, Alert, Critical, Error, Warning, Notice, Informational, Debug).

The trade-off is signal vs noise:

  • Too little logging: you miss the evidence. Many security-relevant events (successful logons, config changes) are Informational or Notice, so a level that is too strict hides them.
  • Too much logging: storage costs explode, the SIEM slows down, and real alerts drown in noise. Debug is meant for short-term troubleshooting and can also leak sensitive data such as session tokens, so turn it off afterwards.

Applications usually use a simpler scale: FATAL, ERROR, WARN, INFO, DEBUG, TRACE. The same rules apply.

What to turn on, by platform

Windows. Configure the Advanced Audit Policy through Group Policy, so every machine gets the same settings. Events every analyst should know:

Event IDMeaningWhy it matters
4624 / 4625successful / failed logonbrute force, password spraying, lateral movement (watch the logon type)
4688new process createdwhat ran; enable “include command line” to see the full command
4720user account createdattackers create backdoor accounts
4728 / 4732member added to a security groupprivilege escalation (for example into Domain Admins)
4719system audit policy changedsomeone may be turning logging off
1102Security log cleareda classic sign of an attacker covering tracks

Many SOCs also deploy Sysmon, a free Microsoft tool that adds detailed events such as process creation with hashes (Event 1) and network connections (Event 3).

Linux. rsyslog or syslog-ng handle classic logs, journald collects systemd logs, and auditd records security events such as file access and command execution. Authentication logs live in /var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL family).

Network devices. Log denied and important allowed traffic, admin logins and configuration changes. Send them to your collector, not just to a local buffer that overwrites itself.

Cloud. Make sure management-plane logging (CloudTrail, Azure Activity Log, Entra ID sign-in logs) is enabled in every account and region, and that it is sent somewhere the account’s own admins cannot easily delete.

Configuration best practices

  • Use a standard baseline: define once what each system type must log, then apply it centrally (Group Policy, configuration management tools like Ansible, or cloud policies).
  • Watch for configuration drift: settings change over time. Periodically verify that systems still log what the baseline says.
  • Include the right fields: timestamp with time zone, hostname, user, source and destination IP, action and outcome.
  • Do not log secrets: passwords, full card numbers and session tokens should never end up in log files.
  • Test it: trigger a failed logon on purpose and confirm it appears in the SIEM, correctly parsed, within minutes.

Key takeaway

If an investigation cannot find evidence because “the events were never recorded”, the fix is audit policy / logging configuration, not a bigger SIEM. If the SIEM is overwhelmed with low-value events, the fix is tuning the logging level or filtering.


2. Time synchronization: making every clock agree

What it means

Time synchronization means every device that produces logs agrees on what time it is, usually to within milliseconds, by getting its time from a common, trusted source using NTP (Network Time Protocol).

This sounds boring until you try to investigate an incident without it. Every computer has its own internal clock, and those clocks drift, gaining or losing seconds a day. After weeks or months without correction, two servers can disagree by minutes. Virtual machines restored from snapshots can be off by days.

Why it is critical for security

  • Correlation: SIEM rules like “failed logons followed by a success within 2 minutes” only work if both events have comparable timestamps.
  • Building a timeline: incident response is about putting events in the right order. Wrong clocks create a wrong story.
  • Evidence: inaccurate timestamps can make log evidence easy to challenge.
  • Authentication: Kerberos (used by Active Directory) rejects authentication if the clocks of client and server differ by more than 5 minutes by default. Certificates and MFA codes also depend on correct time.
WITHOUT NTP WEB01 +4:00 fast · DC01 −3:00 slow · FW01 correct WITH NTP all three within milliseconds of each other 09:57 09:58 09:59 10:00 10:01 10:02 10:03 10:04 10:05 09:57 09:58 09:59 10:00 10:01 10:02 10:03 10:04 10:05 1 FW 2 WEB 3 DC 1 FW 2 WEB 3 DC 1 firewall allows 203.0.113.7 2 web shell uploaded 3 svc_web logs on to DC WITHOUT NTP sorted by (wrong) timestamps 3 09:58:10 DC01 (clock off) svc_web logs on to DC 1 10:00:00 FW01 firewall allows 203.0.113.7 2 10:04:30 WEB01 (clock off) web shell uploaded ! DC logon looks like it came first WITH NTP clocks agree: real order 1 10:00:00 FW01 firewall allows 203.0.113.7 2 10:00:30 WEB01 web shell uploaded 3 10:01:10 DC01 svc_web logs on to DC
FW01, WEB01, DC01
Three example machines: a firewall, a web server and a domain controller (the Windows server that handles logins for the whole network).
Clock drift
Every computer clock gains or loses a little time. Without correction, machines can end up minutes apart, as WEB01 (+4 min) and DC01 (−3 min) do here.
Why it matters
Investigators sort events by time. With wrong clocks, step 3 (the logon) looks like it happened before the attack started, which leads to the wrong conclusions.
NTP
Network Time Protocol keeps every machine within milliseconds of a trusted time source, so the sorted order matches what really happened.
Top: WEB01's clock runs 4 minutes fast and DC01's runs 3 minutes slow. Sorted by timestamp, the domain controller logon appears BEFORE the attack even started, and the story falls apart. Bottom: with NTP, the real order (1, 2, 3) is obvious.

How NTP works

NTP organizes time sources in layers called strata. A stratum number is the distance from a reference clock:

STRATUM 0 reference clocks: GPS, atomic, radio STRATUM 1 public/primary time servers wired to stratum 0 STRATUM 2 YOUR internal NTP servers (e.g. AD PDC emulator) STRATUM 3 servers, endpoints, firewalls, SIEM, cloud VMs Kerberos rejects tickets if clocks differ by more than 5 minutes (default). Secure it: NTS (RFC 8915) or authenticated NTP, and only let approved servers hand out time. STRATUM 0 GPS, atomic, radio clocks STRATUM 1 public time servers wired to stratum 0 STRATUM 2 YOUR internal NTP (e.g. AD PDC emulator) STRATUM 3 servers, endpoints, firewalls, SIEM, VMs Kerberos rejects tickets if clocks differ by more than 5 minutes. Secure it: NTS (RFC 8915) or authenticated NTP.
Stratum
A level in the time hierarchy, counted as distance from a perfect clock. Lower numbers are closer to the reference; 16 means "not synchronized".
Stratum 0
The reference clocks themselves: GPS receivers and atomic clocks. They are hardware, not network servers.
Stratum 1-2
Public time servers wired to those clocks, and below them your own internal NTP servers, often a domain controller (the PDC emulator role in Active Directory).
Stratum 3
Everything else in your network takes time from your internal servers, so all devices agree with each other.
Kerberos
The login system used by Windows networks. It rejects logins when two clocks differ by more than 5 minutes, so bad time can lock people out.
NTS
Network Time Security (RFC 8915) adds encryption and authentication to NTP, so an attacker cannot feed your devices a fake time.
Time flows downhill. Each stratum syncs from the one above it. Point every device at a small set of internal NTP servers, and point those at trusted upstream sources. NTP uses UDP port 123.
  • Stratum 0: the reference clocks themselves (GPS receivers, atomic clocks). They do not sit on the network directly.
  • Stratum 1: servers directly connected to a stratum 0 device.
  • Stratum 2, 3, …: servers that sync from the level above. The maximum usable stratum is 15; 16 means “unsynchronized”.

NTP uses UDP port 123. In an Active Directory domain, members sync from domain controllers, and the domain controller holding the PDC emulator role should sync from a reliable external source.

Best practices

  • Use internal NTP servers. Point all devices at two or more internal time servers, and point those at several trusted upstream sources. Fewer devices talk to the internet, and everyone gets the same time.
  • Store timestamps in UTC. Time zones and daylight-saving changes make local times ambiguous (01:30 can happen twice in one night). Store and correlate in UTC, and convert to local time only for display. Use an unambiguous format such as ISO 8601: 2026-11-27T09:14:03.512Z (the Z means UTC).
  • Prefer log formats that carry full timestamps. Classic syslog (RFC 3164) has no year and no time zone. RFC 5424 syslog and JSON logs can include both.
  • Secure NTP. A rogue or spoofed time source can shift clocks, breaking authentication and corrupting evidence. Use NTS (Network Time Security, RFC 8915) or authenticated NTP where supported, and restrict who may serve time on your network.
  • Monitor drift. Alert when a host’s offset exceeds a threshold. Useful commands:
# Windows
w32tm /query /status          # current source, stratum and last sync
w32tm /resync                 # force a resync

# Linux
timedatectl                   # is NTP enabled and synchronized?
chronyc tracking              # offset from the time source (chrony)
chronyc sources -v            # which servers are being used

Key takeaway

When events appear out of order, cannot be correlated across systems, or Kerberos authentication suddenly fails, check NTP / time synchronization first. When logs from different regions are confusing, normalize timestamps to UTC.


3. Ingestion: getting logs into one place

What it means

Log ingestion is the process of collecting log data from many different sources and bringing it into a central system, usually a SIEM (Security Information and Event Management) platform, where it can be searched, correlated and turned into alerts.

Think of a SIEM as a newsroom. Reporters (your servers, firewalls and cloud accounts) are all over the city. Ingestion is the phone lines, couriers and translators that get every report to the editor’s desk, in a language the editor understands, without losing any on the way.

Why centralize at all? Because attacks cross systems. A single intrusion might touch a firewall, a web server, a domain controller and a cloud account. Each one only sees its own piece. Only when the pieces sit side by side can you see the whole attack.

Where logs come from

SourceTypical logsExamples
Endpoints and serversOS security events, process starts, logonsWindows Security log, Sysmon, Linux auth.log / secure, auditd
Network devicesallowed/denied traffic, VPN logons, config changesfirewalls, routers, switches, IDS/IPS, proxies
Identitysign-ins, MFA results, privilege changesActive Directory, Entra ID (Azure AD), Okta
Cloud platformsAPI calls and admin activityAWS CloudTrail, Azure Activity Log, Google Cloud Audit Logs
Applicationslogins, errors, transactionsweb servers, databases, custom apps
Security toolsdetections and blocksEDR, antivirus, email gateways, DLP

How logs travel: push vs pull, agent vs agentless

There are two big questions in ingestion: who starts the conversation, and is there software installed on the source.

  • Push: the source sends events as they happen. Syslog and Windows Event Forwarding work this way. This is near real time.
  • Pull: the SIEM or collector asks the source for new events on a schedule, usually through an API. Most cloud logs (for example CloudTrail or Microsoft 365 audit logs) are pulled.
Agent-basedAgentless
Howa small program on the host reads logs and ships themthe host sends natively (syslog, WEF) or the SIEM pulls (API, WMI)
Prosrich data, can filter and buffer locally, encrypts, survives network blipsnothing to install, works on appliances you cannot modify
Consmust be deployed, patched and monitored on every hostless control, often less detail, more network dependency
ExamplesSplunk Universal Forwarder, Elastic Agent, Wazuh agent, NXLogsyslog from a firewall, Windows Event Forwarding, cloud API pulls

The common transport protocols are worth memorizing:

  • Syslog: the universal language of network devices and Linux. Traditionally UDP 514 (fast, but no delivery guarantee and no encryption), commonly TCP 514 (reliable), and TCP 6514 for syslog over TLS (reliable and encrypted, RFC 5425).
  • Windows Event Forwarding (WEF): built into Windows. Sources forward selected events to a Windows Event Collector (WEC) over WinRM (HTTP 5985 / HTTPS 5986).
  • HTTPS APIs: cloud services and modern apps, usually JSON.
Windows server agent or WEF (WinRM 5985/5986) Linux server rsyslog over TLS, TCP 6514 Firewall / router syslog, UDP or TCP 514 Cloud (AWS / Azure) API pull: CloudTrail, Entra ID Web application JSON over HTTPS COLLECTOR receive + decrypt buffer / queue filter noise forward (TLS) SIEM 1. parse raw text 2. normalize fields 3. enrich: GeoIP, asset, user, threat intel 4. index + correlate 5. alert the analyst PUSH: source sends as events happen PULL: SIEM polls an API on a schedule Windows server agent or WEF (WinRM) Linux server rsyslog over TLS, TCP 6514 Firewall / router syslog, UDP or TCP 514 Cloud (AWS / Azure) API pull: CloudTrail, Entra ID Web application JSON over HTTPS COLLECTOR receive + decrypt, buffer / queue filter noise, forward (TLS) SIEM 1. parse raw text 2. normalize fields 3. enrich: GeoIP, asset, TI 4. index + correlate 5. alert the analyst PUSH: source sends as it happens PULL: SIEM polls an API
Agent
A small program installed on a server that reads its logs and sends them on. It can filter, buffer and encrypt before sending.
WEF / WinRM
Windows Event Forwarding is built into Windows: servers forward chosen events to a central Windows Event Collector, using the WinRM remote-management protocol (ports 5985/5986).
Syslog (514 / 6514)
The standard log protocol for Linux and network devices. Port 514 is plain text; port 6514 wraps it in TLS encryption so nobody can read or alter it on the way.
API pull
Cloud services keep their own logs. The collector or SIEM asks their API (for example AWS CloudTrail or Microsoft Entra ID) for new events every few minutes.
Collector
A middle server that receives logs from everything, decrypts them, holds them in a queue if the SIEM is busy or down, drops obvious noise and forwards the rest securely.
SIEM
Security Information and Event Management: the central system that stores, searches and correlates all logs, adds context (enrichment) and alerts analysts.
Push vs pull
Push: the source sends each event as it happens (near real time). Pull: the SIEM asks the source for new events on a schedule.
Sources push (syslog, agents, WEF) or are pulled (cloud APIs). A collector buffers and forwards, so a SIEM outage or a traffic spike does not lose events.

Parsing, normalization and enrichment

Raw logs arrive in many formats: classic syslog lines, Windows XML events, JSON, vendor formats like CEF (Common Event Format) and LEEF (Log Event Extended Format). To search across all of them, the SIEM must:

  1. Parse: break the raw text into named fields (time, host, user, IP, action).
  2. Normalize: map those fields into one common schema, so a “failed logon” from Windows and a “Failed password” from Linux both become event.action = logon-failure.
  3. Enrich: add context the original log did not have: the country for an IP (GeoIP), the owner and criticality of the asset, the user’s department, or whether the IP appears in threat intelligence feeds.
RAW A · Windows Security log
EventID=4625 TimeCreated=2026-11-27T09:14:03.512Z TargetUserName=jsmith IpAddress=203.0.113.7 Computer=DC01 LogonType=3
RAW B · Linux /var/log/auth.log
Nov 27 09:14:05 web01 sshd[2211]: Failed password for root from 203.0.113.7 port 52113 ssh2
FieldFrom AFrom B
@timestamp2026-11-27T09:14:03.512Z2026-11-27T09:14:05Z *
event.actionlogon-failurelogon-failure
user.namejsmithroot
source.ip203.0.113.7203.0.113.7
host.nameDC01web01
event.providerWindows Security (4625)sshd

* Classic syslog (RFC 3164) has no year and no time zone. The SIEM has to assume them, which is one more reason to send RFC 5424 / ISO 8601 timestamps in UTC.

Raw logs from different systems describe the same thing in different words. After normalization the SIEM can see one attacker IP failing logins on two servers within seconds and raise one alert.

Without normalization, an analyst would need a different search for every product. With it, one query (“show all failed logons from this IP”) covers everything.

Aggregation and correlation

Once data is normalized, the SIEM can aggregate (combine repeated events, like 500 identical firewall denies, into one record with a count) and correlate (connect related events from different sources). A correlation rule might say: five or more failed logons from one IP across any hosts within two minutes, followed by a success, raise a “possible password spraying” alert.

Ingestion problems you should recognize

  • Volume and cost: SIEMs are often licensed by EPS (events per second) or GB per day. Sending everything can be very expensive.
  • Dropped events: UDP syslog can silently lose packets under load. Collectors with buffers or queues prevent loss when the SIEM is slow or offline.
  • Silent sources: if a server stops sending logs, nothing alerts you by default. Good SOCs alert on missing data (“no events from DC01 in 15 minutes”).
  • Parsing failures: a vendor update changes the log format, the parser breaks, and fields come in empty. Monitor parsing error rates.
  • Filtering at the source: dropping noisy, low-value events before ingestion saves money, but be careful not to throw away evidence you will need later.

Key takeaway

When logs from many devices “cannot be correlated” or “use different formats”, the answer is normalization in a SIEM. When syslog messages get lost or travel unencrypted, move from UDP 514 to TCP or TLS syslog (6514).


4. Integrity and security: protecting the evidence

What it means

Log integrity means you can prove the logs are complete and unaltered since they were written. Log security means protecting them from being read, changed or deleted by the wrong people.

Why does this matter so much? Because attackers know logs can expose them. Clearing or disabling logs is a well-known attacker technique (MITRE ATT&CK T1070 Indicator Removal, including T1070.001 Clear Windows Event Logs, and T1562.002 Disable Windows Event Logging). If an attacker with admin rights can edit the only copy of the logs, those logs prove nothing.

Logs may also end up as evidence in disciplinary cases or court. Then you must show they are trustworthy, which is where chain of custody comes in.

The CIA triad, applied to logs

  • Confidentiality: logs contain usernames, IP addresses, internal hostnames and sometimes personal data. Not everyone should read them.
  • Integrity: nobody can change or delete a log entry without it being detected.
  • Availability: logs are there when needed, even if the original server is wiped or encrypted by ransomware.

How to protect logs

1. Get them off the box, fast. The single most important control. Forward logs to a central collector in (near) real time. If an attacker clears the local Security log, the copies already in the SIEM survive, and the clearing itself (Event 1102) becomes an alert.

2. Encrypt in transit. Use TLS syslog (TCP 6514), HTTPS-based agents or WEF over HTTPS, so logs cannot be read or modified on the network.

3. Control access (least privilege and separation of duties). System administrators should not be able to delete the SIEM’s copy of the logs about their own actions. Give analysts read access, restrict delete rights to very few people, and log access to the logs themselves.

4. Make storage immutable. Use WORM (write once, read many) storage, for example object storage with retention locks such as AWS S3 Object Lock, or append-only log stores. Data can be added, but not changed or deleted until the retention period ends.

5. Use hashing to detect changes. A cryptographic hash (for example SHA-256) is a fingerprint of the data. Hash log files when they are closed and store the hashes separately. Stronger still, chain the hashes, so each entry’s hash covers the previous one:

ENTRY #1 09:14:03 FAIL jsmith prev: 0000… hash: 3c7e… ENTRY #2 09:14:05 FAIL root prev: 3c7e… hash: a91f… ENTRY #3 09:14:09 OK jsmith prev: a91f… hash: 5d20… ENTRY #4 09:15:40 new user prev: 5d20… hash: e7c4… ✓ chain verified: every stored 'prev' matches the hash before it 09:14:09 OK admin hash: 9b2d… (changed!) ≠ ✗ entry #3 was edited: 9b2d… ≠ 5d20… stored in entry #4, alarm! ENTRY #1 09:14:03 FAIL jsmith prev: 0000… hash: 3c7e… ENTRY #2 09:14:05 FAIL root prev: 3c7e… hash: a91f… ENTRY #3 09:14:09 OK jsmith prev: a91f… hash: 5d20… ENTRY #4 09:15:40 new user prev: 5d20… hash: e7c4… ✓ chain verified: each 'prev' matches the hash before it 09:14:09 OK admin hash: 9b2d… changed ≠ ✗ entry #3 was edited: 9b2d… ≠ 5d20… stored in #4
Entry
One log record, for example "09:14:05 FAIL root" means a failed login for the root account at 09:14:05.
Hash
A short fingerprint calculated from the data (for example with SHA-256). Change even one character and the fingerprint changes completely.
Prev
Each entry also stores the hash of the entry before it. That links the entries into a chain, so editing an old entry breaks every link after it.
Tampering
In the animation, an attacker changes entry 3 from "jsmith" to "admin". Its new hash no longer matches what entry 4 stored, so the change is detected.
Each entry's hash covers the entry AND the previous hash. Change one old line (here an attacker rewrites who logged in) and its hash changes, so the next block's 'prev' no longer matches. Verification breaks from that point on.

Cloud services use the same idea. AWS CloudTrail’s log file integrity validation, for example, creates signed digest files containing hashes of every log file, so you can prove whether a file was modified or deleted.

6. Digitally sign. Signing hashes with a private key proves who produced them and that they have not changed since.

7. Monitor the logging pipeline itself. Alert on: logs cleared (1102, 104), audit policy changed (4719), logging service stopped, agents that stop sending heartbeats, and sudden drops in volume from a source.

8. Document chain of custody. When logs are collected as evidence, record who collected them, when, how, the hash values, and every hand-off, so their integrity can be demonstrated later.

Key takeaway

To prove logs were not altered, use hashing and digital signatures. To survive an attacker clearing local logs, forward them to a SIEM in real time. To keep logs unchangeable for years, use WORM / immutable storage.


5. Retention: how long to keep logs

What it means

Log retention is the policy that defines how long each type of log is kept, where and in what form it is kept during that time, and how it is destroyed at the end.

There are two opposite risks:

  • Keeping too little: attackers often stay hidden for weeks or months before anyone notices. If you only keep 14 days of logs, you may discover a breach and find that the evidence of how it started is already gone.
  • Keeping too much: storage costs grow forever, searches slow down, and old logs full of personal data become a privacy and legal liability. Under the GDPR storage limitation principle, for example, personal data (and log files often contain it) should not be kept longer than necessary.

What drives the retention period

  1. Laws and regulations: these set minimums for some industries and data types. Examples often cited:
    • PCI DSS (card payments): keep audit log history for at least 12 months, with at least the most recent 3 months immediately available for analysis (requirement 10.5.1 in v4.0).
    • HIPAA (US healthcare): required security documentation must be kept for 6 years, and many organizations apply that period to related audit logs.
    • SOX (US public companies): financial audit records are commonly retained for 7 years.
  2. Contracts and cyber-insurance requirements.
  3. Internal policy and investigation needs: how far back do your incident responders realistically need to look?
  4. Legal holds: when litigation or an investigation is expected, the relevant logs must be preserved regardless of the normal schedule until the hold is released.

Always check the current text of the regulations that apply to you. Numbers change between versions, and lawyers and compliance teams should set the final policy.

Storage tiers: not all old logs need to be fast

Recent logs are searched constantly, and old logs rarely. So most organizations store logs in tiers:

HOT 0 to 30 days fast SSD, fully indexed searched in seconds WARM 30 to 90 days cheaper disk still searchable COLD 90 days to 1 yr compressed slower queries ARCHIVE 1 yr to N yrs object store / WORM restore to search cost per GB ▼ goes down search speed ▼ goes down time: logs move right as they age DISPOSE policy expired: secure delete, documented LEGAL HOLD investigation or lawsuit: deletion is paused as logs age: cost and search speed drop HOT 0 to 30 days fast SSD, fully indexed searched in seconds WARM 30 to 90 days cheaper disk still searchable COLD 90 days to 1 yr compressed slower queries ARCHIVE 1 yr to N yrs object store / WORM restore to search DISPOSE policy expired: secure delete LEGAL HOLD lawsuit or investigation: no deletion
Hot
The newest logs on fast, expensive storage, fully indexed. Analysts search these all day and get answers in seconds.
Warm
Older logs on cheaper disks. Still searchable, just slower.
Cold
Compressed to save space. Searches are slow and used mainly for investigations.
Archive
Long-term storage such as cloud object storage, often WORM (write once, read many: nobody can edit or delete it). Logs must be restored before searching.
Dispose
When the retention period ends, logs are deleted in a documented, secure way. Keeping them longer adds cost and privacy risk.
Legal hold
If there is a lawsuit or investigation, the affected logs must be kept regardless of the normal schedule until the hold is lifted.
Example policy only. Your real numbers come from law, contracts, industry standards and how far back investigations need to look. When the clock runs out, logs are securely deleted, unless a legal hold freezes them.
  • Hot: the last days or weeks, on fast storage and fully indexed. Live investigations and alerting happen here.
  • Warm: older, on cheaper storage, still searchable but slower.
  • Cold: compressed, cheap, slow to search.
  • Archive: object storage or tape, often WORM-protected, must be restored before searching. Cheapest per GB.

At the end of the retention period, logs should be securely disposed of, deleted in a way that is documented and verifiable. Keeping data “just in case” past the policy is a risk, not a safety net.

Estimating storage

Capacity planning starts with a simple formula:

events per second × average event size × 86,400 seconds = bytes per day

For example, 2,000 EPS × 500 bytes × 86,400 ≈ 86.4 GB of raw logs per day, or more than 31 TB per year before compression. Try your own numbers:

Raw per day86.4 GB
Hot tier2.59 TB
Archive tier2.89 TB
Total5.49 TB
Formula: EPS × bytes per event × 86,400 seconds = bytes per day. Real numbers vary with indexing overhead, replicas and your SIEM's own compression, so treat this as a first estimate.

Key takeaway

Compliance needs are met with a retention policy plus an archive tier. If investigators cannot find logs from before a breach was detected, retention was too short. Logs needed for a lawsuit go under legal hold, which overrides normal deletion.


Putting it all together

ConceptThe question it answersKey controls
ConfigurationAre we recording the right events, at the right detail?audit policy baselines, logging levels, Sysmon/auditd, no secrets in logs, drift checks
Time synchronizationCan we trust the order of events?internal NTP hierarchy, UDP 123, UTC + ISO 8601, NTS, drift monitoring
IngestionDo all the logs reach one place, in one language?agents, syslog (TLS 6514), WEF, APIs, collectors with buffers, parsing, normalization, enrichment, missing-source alerts
Integrity and securityCan we prove nobody altered or deleted them?real-time forwarding, TLS, least privilege, WORM, hashing, signatures, alerts on log clearing, chain of custody
RetentionWill the logs still be there, and are we keeping them too long?policy driven by regulation and investigations, hot/warm/cold/archive tiers, legal hold, secure disposal

The five concepts depend on each other. Perfect retention is useless if ingestion dropped the events. Perfect ingestion is useless if the configuration never recorded them, or if the clocks disagreed when it did. And none of it holds up as evidence without integrity and accurate time.

Quick self-check:

  • Which port does syslog over TLS use? (TCP 6514)
  • Which Windows event shows the Security log was cleared? (1102)
  • What is the default Kerberos clock-skew tolerance? (5 minutes)
  • What does NTP stratum 16 mean? (unsynchronized)
  • What does a legal hold do to the retention schedule? (pauses deletion for the affected data)

Good logging is not glamorous, but it is the difference between “we think the attacker got in somehow” and “the attacker logged in from 203.0.113.7 at 09:14:09 UTC using jsmith’s account, and here is the proof”.