Skip to content

Commit

Permalink
Add os.type to Auditbeat system/host dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansr committed Feb 2, 2021
1 parent fa42ee7 commit dc549df
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add ECS categorization info for auditd module {pull}18596[18596]
- Add several improvements for auditd module for improved ECS field mapping {pull}22647[22647]
- Add ECS 1.7 `configuration` categorization in certain events in auditd module. {pull}23000[23000]
- system/host: Add new ECS 1.8 field `os.type` in `host.os.type`. {pull}23513[23513]

*Filebeat*

Expand Down
10 changes: 10 additions & 0 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12336,6 +12336,16 @@ type: keyword
The operating system's kernel version.
type: keyword
--
*`system.audit.host.os.type`*::
+
--
OS type (see ECS os.type).
type: keyword
--
Expand Down
2 changes: 1 addition & 1 deletion x-pack/auditbeat/module/system/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions x-pack/auditbeat/module/system/host/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"timezone.name": "UTC",
"timezone.offset.sec": 0,
"type": "linux",
"uptime": 18661357350265
}
}
Expand Down
4 changes: 4 additions & 0 deletions x-pack/auditbeat/module/system/host/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@
type: keyword
description: >
The operating system's kernel version.
- name: type
type: keyword
description: >
OS type (see ECS os.type).
5 changes: 5 additions & 0 deletions x-pack/auditbeat/module/system/host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ func (host *Host) toMapStr() common.MapStr {
mapstr.Put("os.codename", host.Info.OS.Codename)
}

if host.Info.OS.Type != "" {
mapstr.Put("os.type", host.Info.OS.Type)
}

var ipStrings []string
for _, ip := range host.Ips {
ipStrings = append(ipStrings, ip.String())
Expand Down Expand Up @@ -362,6 +366,7 @@ func hostEvent(host *Host, eventType string, action eventAction) mb.Event {
hostFields.CopyFieldsTo(hostTopLevel, "os.kernel")
hostFields.CopyFieldsTo(hostTopLevel, "os.name")
hostFields.CopyFieldsTo(hostTopLevel, "os.platform")
hostFields.CopyFieldsTo(hostTopLevel, "os.type")
hostFields.CopyFieldsTo(hostTopLevel, "os.version")

event.RootFields.Put("host", hostTopLevel)
Expand Down

0 comments on commit dc549df

Please sign in to comment.