Skip to content

Commit aadf8db

Browse files
author
Mathieu Martin
authored
Add Syslog fields to ECS (#525)
Here's the intended mapping in different situations 1. Syslog event / event source specifies different severity * log.syslog.severity.code: Syslog severity number * log.syslog.severity.name: Syslog severity label * event.severity: Source severity number * log.level: Source severity label 2. Syslog event / event source does not specify different severity * log.syslog.severity.code: Syslog severity number * log.syslog.severity.name: Syslog severity label * event.severity: (optional) Syslog severity number * log.level: (optional) Syslog severity label 3. Non-syslog event, event source specifies severity * event.severity: Source severity number * log.level: Source severity label
1 parent fef7d6b commit aadf8db

File tree

14 files changed

+634
-44
lines changed

14 files changed

+634
-44
lines changed

CHANGELOG.next.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Thanks, you're awesome :-) -->
1111

1212
### Added
1313

14-
* Add group.domain field #547
14+
* Added fields in `log.*` to allow for full Syslog mapping. #525
15+
* Add group.domain field #547
1516
* Added `error.stack_trace` field. #562
1617
* Added `log.origin.file.name`, `log.origin.function` and `log.origin.file.line` fields. #563
1718
* Added `service.node.name` to allow distinction between different nodes of the same service running on the same host. #565

code/go/ecs/event.go

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/go/ecs/log.go

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/field-details.asciidoc

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,11 @@ type: long
12771277
// ===============================================================
12781278

12791279
| event.severity
1280-
| Severity describes the original severity of the event. What the different severity values mean can very different between use cases. It's up to the implementer to make sure severities are consistent across events.
1280+
| The numeric severity of the event according to your event source.
1281+
1282+
What the different severity values mean can be different between sources and use cases. It's up to the implementer to make sure severities are consistent across events from the same source.
1283+
1284+
The Syslog severity belongs in `log.syslog.severity.code`. `event.severity` is meant to represent the severity according to the event source (e.g. firewall, IDS). If the event source does not publish its own severity, you may optionally copy the `log.syslog.severity.code` to `event.severity`.
12811285

12821286
type: long
12831287

@@ -2112,11 +2116,13 @@ Fields which are specific to log events.
21122116
| log.level
21132117
| Original log level of the log event.
21142118

2115-
Some examples are `warn`, `error`, `i`.
2119+
If the source of the event provides a log level or textual severity, this is the one that goes in `log.level`. If your source doesn't specify one, you may put your event transport's severity here (e.g. Syslog severity).
2120+
2121+
Some examples are `warn`, `err`, `i`, `informational`.
21162122

21172123
type: keyword
21182124

2119-
example: `err`
2125+
example: `error`
21202126

21212127
| core
21222128

@@ -2181,6 +2187,80 @@ example: `Sep 19 08:26:10 localhost My log`
21812187

21822188
// ===============================================================
21832189

2190+
| log.syslog
2191+
| The Syslog metadata of the event, if the event was transmitted via Syslog. Please see RFCs 5424 or 3164.
2192+
2193+
type: object
2194+
2195+
2196+
2197+
| extended
2198+
2199+
// ===============================================================
2200+
2201+
| log.syslog.facility.code
2202+
| The Syslog numeric facility of the log event, if available.
2203+
2204+
According to RFCs 5424 and 3164, this value should be an integer between 0 and 23.
2205+
2206+
type: long
2207+
2208+
example: `23`
2209+
2210+
| extended
2211+
2212+
// ===============================================================
2213+
2214+
| log.syslog.facility.name
2215+
| The Syslog text-based facility of the log event, if available.
2216+
2217+
type: keyword
2218+
2219+
example: `local7`
2220+
2221+
| extended
2222+
2223+
// ===============================================================
2224+
2225+
| log.syslog.priority
2226+
| Syslog numeric priority of the event, if available.
2227+
2228+
According to RFCs 5424 and 3164, the priority is 8 * facility + severity. This number is therefore expected to contain a value between 0 and 191.
2229+
2230+
type: long
2231+
2232+
example: `135`
2233+
2234+
| extended
2235+
2236+
// ===============================================================
2237+
2238+
| log.syslog.severity.code
2239+
| The Syslog numeric severity of the log event, if available.
2240+
2241+
If the event source publishing via Syslog provides a different numeric severity value (e.g. firewall, IDS), your source's numeric severity should go to `event.severity`. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to `event.severity`.
2242+
2243+
type: long
2244+
2245+
example: `3`
2246+
2247+
| extended
2248+
2249+
// ===============================================================
2250+
2251+
| log.syslog.severity.name
2252+
| The Syslog numeric severity of the log event, if available.
2253+
2254+
If the event source publishing via Syslog provides a different severity value (e.g. firewall, IDS), your source's text severity should go to `log.level`. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to `log.level`.
2255+
2256+
type: keyword
2257+
2258+
example: `Error`
2259+
2260+
| extended
2261+
2262+
// ===============================================================
2263+
21842264
|=====
21852265

21862266
[[ecs-network]]

generated/beats/fields.ecs.yml

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,10 +1020,17 @@
10201020
level: core
10211021
type: long
10221022
format: string
1023-
description: Severity describes the original severity of the event. What the
1024-
different severity values mean can very different between use cases. It's
1025-
up to the implementer to make sure severities are consistent across events.
1026-
example: '7'
1023+
description: 'The numeric severity of the event according to your event source.
1024+
1025+
What the different severity values mean can be different between sources and
1026+
use cases. It''s up to the implementer to make sure severities are consistent
1027+
across events from the same source.
1028+
1029+
The Syslog severity belongs in `log.syslog.severity.code`. `event.severity`
1030+
is meant to represent the severity according to the event source (e.g. firewall,
1031+
IDS). If the event source does not publish its own severity, you may optionally
1032+
copy the `log.syslog.severity.code` to `event.severity`.'
1033+
example: 7
10271034
- name: start
10281035
level: extended
10291036
type: date
@@ -1592,8 +1599,12 @@
15921599
ignore_above: 1024
15931600
description: 'Original log level of the log event.
15941601
1595-
Some examples are `warn`, `error`, `i`.'
1596-
example: err
1602+
If the source of the event provides a log level or textual severity, this
1603+
is the one that goes in `log.level`. If your source doesn''t specify one,
1604+
you may put your event transport''s severity here (e.g. Syslog severity).
1605+
1606+
Some examples are `warn`, `err`, `i`, `informational`.'
1607+
example: error
15971608
- name: logger
15981609
level: core
15991610
type: keyword
@@ -1635,6 +1646,57 @@
16351646
This field is not indexed and doc_values are disabled so it can''t be queried
16361647
but the value can be retrieved from `_source`.'
16371648
example: Sep 19 08:26:10 localhost My log
1649+
- name: syslog
1650+
level: extended
1651+
type: object
1652+
object_type: keyword
1653+
description: The Syslog metadata of the event, if the event was transmitted
1654+
via Syslog. Please see RFCs 5424 or 3164.
1655+
- name: syslog.facility.code
1656+
level: extended
1657+
type: long
1658+
format: string
1659+
description: 'The Syslog numeric facility of the log event, if available.
1660+
1661+
According to RFCs 5424 and 3164, this value should be an integer between 0
1662+
and 23.'
1663+
example: 23
1664+
- name: syslog.facility.name
1665+
level: extended
1666+
type: keyword
1667+
ignore_above: 1024
1668+
description: The Syslog text-based facility of the log event, if available.
1669+
example: local7
1670+
- name: syslog.priority
1671+
level: extended
1672+
type: long
1673+
format: string
1674+
description: 'Syslog numeric priority of the event, if available.
1675+
1676+
According to RFCs 5424 and 3164, the priority is 8 * facility + severity.
1677+
This number is therefore expected to contain a value between 0 and 191.'
1678+
example: 135
1679+
- name: syslog.severity.code
1680+
level: extended
1681+
type: long
1682+
description: 'The Syslog numeric severity of the log event, if available.
1683+
1684+
If the event source publishing via Syslog provides a different numeric severity
1685+
value (e.g. firewall, IDS), your source''s numeric severity should go to `event.severity`.
1686+
If the event source does not specify a distinct severity, you can optionally
1687+
copy the Syslog severity to `event.severity`.'
1688+
example: 3
1689+
- name: syslog.severity.name
1690+
level: extended
1691+
type: keyword
1692+
ignore_above: 1024
1693+
description: 'The Syslog numeric severity of the log event, if available.
1694+
1695+
If the event source publishing via Syslog provides a different severity value
1696+
(e.g. firewall, IDS), your source''s text severity should go to `log.level`.
1697+
If the event source does not specify a distinct severity, you can optionally
1698+
copy the Syslog severity to `log.level`.'
1699+
example: Error
16381700
- name: network
16391701
title: Network
16401702
group: 2

generated/csv/fields.csv

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,18 @@ http.response.body.content,keyword,extended,Hello world,1.2.0-dev
202202
http.response.bytes,long,extended,1437,1.2.0-dev
203203
http.response.status_code,long,extended,404,1.2.0-dev
204204
http.version,keyword,extended,1.1,1.2.0-dev
205-
log.level,keyword,core,err,1.2.0-dev
205+
log.level,keyword,core,error,1.2.0-dev
206206
log.logger,keyword,core,org.elasticsearch.bootstrap.Bootstrap,1.2.0-dev
207207
log.origin.file.line,integer,extended,42,1.2.0-dev
208208
log.origin.file.name,keyword,extended,Bootstrap.java,1.2.0-dev
209209
log.origin.function,keyword,extended,init,1.2.0-dev
210210
log.original,keyword,core,Sep 19 08:26:10 localhost My log,1.2.0-dev
211+
log.syslog,object,extended,,1.2.0-dev
212+
log.syslog.facility.code,long,extended,23,1.2.0-dev
213+
log.syslog.facility.name,keyword,extended,local7,1.2.0-dev
214+
log.syslog.priority,long,extended,135,1.2.0-dev
215+
log.syslog.severity.code,long,extended,3,1.2.0-dev
216+
log.syslog.severity.name,keyword,extended,Error,1.2.0-dev
211217
network.application,keyword,extended,aim,1.2.0-dev
212218
network.bytes,long,core,368,1.2.0-dev
213219
network.community_id,keyword,extended,1:hO+sN4H+MG5MY/8hIrXPqc4ZQz0=,1.2.0-dev

0 commit comments

Comments
 (0)