Lesson 5 of 5 · 25 min read

Worked Example: One SSH Login, Three Schema Representations

The best way to internalize schema differences is to look at the same real-world event in each format side by side. Here’s a single SSH login event — one user, one action, three schemas.

The event: jdoe successfully logs in to web-01.prod.corp.local from 203.0.113.55 via SSH with a public key at 09:23:14 UTC on 2024-03-15.


Raw syslog (OpenSSH default)

Mar 15 09:23:14 web-01 sshd[23421]: Accepted publickey for jdoe from 203.0.113.55 port 52341 ssh2: RSA SHA256:abc123def456...

What you get: a single line of free-form text with implicit structure. The format is:

<timestamp> <hostname> <program>[<pid>]: <message>

Problems:

To extract fields in Splunk SPL:

index=linux sourcetype=syslog "sshd" "Accepted"
| rex field=_raw "Accepted (?<auth_method>\w+) for (?<user>\w+) from (?<src_ip>\S+)"
| table _time, host, user, src_ip, auth_method

If OpenSSH adds a field before “Accepted”, this regex fails silently.




Side-by-Side Field Mapping

ConceptRaw SyslogECSOCSF
TimestampMar 15 09:23:14@timestamp: "2024-03-15T09:23:14.000Z"time: 1710491994000
Usernameparsed from messageuser.name: "jdoe"actor.user.name: "jdoe"
Source IPparsed from messagesource.ip: "203.0.113.55"src_endpoint.ip: "203.0.113.55"
Destination hostweb-01host.name: "web-01.prod.corp.local"dst_endpoint.hostname: "web-01.prod.corp.local"
Outcomepattern match “Accepted”event.outcome: "success"status_id: 1
Auth methodparsed from message(not in core ECS)auth_protocol: "SSH"

Building the End-of-Module Challenge

This lesson sets up the module challenge: given 5 log samples in different formats, produce a field mapping table. Each sample is a different source:

  1. Windows Security 4625 (EVTX/XML) — failed logon
  2. Linux auditd (type=USER_LOGIN) — SSH login failure
  3. AWS CloudTrail ConsoleLogin — AWS console authentication
  4. Zeek conn.log — network connection record
  5. Okta System Log — authentication event

For each, you’ll map to ECS fields: user.name, source.ip, host.name, event.outcome, event.action, @timestamp.

This exercise will surface exactly which sources are already ECS-normalized and which require custom field mapping work.

Elastic ECS Reference— Elastic OCSF Authentication Class— OCSF