Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add host metadata processor #5968

Merged
merged 2 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Preserve runtime from container statuses in Kubernetes autodiscover {pull}6456[6456]
- Experimental feature setup.template.append_fields added. {pull}6024[6024]
- Add appender support to autodiscover {pull}6469[6469]
- Add add_host_metadata processor {pull}5968[5968]

*Auditbeat*

Expand Down
1 change: 1 addition & 0 deletions auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ auditbeat.modules:
#
#processors:
#- add_docker_metadata: ~
#- add_host_metadata: ~

#============================= Elastic Cloud ==================================

Expand Down
57 changes: 57 additions & 0 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ grouped in the following categories:
* <<exported-fields-common>>
* <<exported-fields-docker-processor>>
* <<exported-fields-file_integrity>>
* <<exported-fields-host-processor>>
* <<exported-fields-kubernetes-processor>>

--
Expand Down Expand Up @@ -2527,6 +2528,62 @@ type: keyword

SHA512/256 hash of the file.

[[exported-fields-host-processor]]
== Host fields

Info collected for the host machine.




[float]
=== `host.hostname`

type: keyword

Hostname.


[float]
=== `host.id`

type: keyword

Unique host id.


[float]
=== `host.architecture`

type: keyword

Host architecture (e.g. x86_64, arm, ppc, mips).


[float]
=== `host.os.platform`

type: object

OS platform (e.g. centos, ubuntu, windows).


[float]
=== `host.os.version`

type: object

OS version.


[float]
=== `host.os.family`

type: object

OS family (e.g. redhat, debian, freebsd, windows).


[[exported-fields-kubernetes-processor]]
== Kubernetes fields

Expand Down
57 changes: 57 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ grouped in the following categories:
* <<exported-fields-beat>>
* <<exported-fields-cloud>>
* <<exported-fields-docker-processor>>
* <<exported-fields-host-processor>>
* <<exported-fields-icinga>>
* <<exported-fields-iis>>
* <<exported-fields-kafka>>
Expand Down Expand Up @@ -647,6 +648,62 @@ type: object
Image labels.


[[exported-fields-host-processor]]
== Host fields

Info collected for the host machine.




[float]
=== `host.hostname`

type: keyword

Hostname.


[float]
=== `host.id`

type: keyword

Unique host id.


[float]
=== `host.architecture`

type: keyword

Host architecture (e.g. x86_64, arm, ppc, mips).


[float]
=== `host.os.platform`

type: object

OS platform (e.g. centos, ubuntu, windows).


[float]
=== `host.os.version`

type: object

OS version.


[float]
=== `host.os.family`

type: object

OS family (e.g. redhat, debian, freebsd, windows).


[[exported-fields-icinga]]
== Icinga fields

Expand Down
1 change: 1 addition & 0 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ filebeat.inputs:
#
#processors:
#- add_docker_metadata: ~
#- add_host_metadata: ~

#============================= Elastic Cloud ==================================

Expand Down
57 changes: 57 additions & 0 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ grouped in the following categories:
* <<exported-fields-cloud>>
* <<exported-fields-common>>
* <<exported-fields-docker-processor>>
* <<exported-fields-host-processor>>
* <<exported-fields-http>>
* <<exported-fields-icmp>>
* <<exported-fields-kubernetes-processor>>
Expand Down Expand Up @@ -296,6 +297,62 @@ type: object
Image labels.


[[exported-fields-host-processor]]
== Host fields

Info collected for the host machine.




[float]
=== `host.hostname`

type: keyword

Hostname.


[float]
=== `host.id`

type: keyword

Unique host id.


[float]
=== `host.architecture`

type: keyword

Host architecture (e.g. x86_64, arm, ppc, mips).


[float]
=== `host.os.platform`

type: object

OS platform (e.g. centos, ubuntu, windows).


[float]
=== `host.os.version`

type: object

OS version.


[float]
=== `host.os.family`

type: object

OS family (e.g. redhat, debian, freebsd, windows).


[[exported-fields-http]]
== HTTP monitor fields

Expand Down
1 change: 1 addition & 0 deletions heartbeat/heartbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ heartbeat.scheduler:
#
#processors:
#- add_docker_metadata: ~
#- add_host_metadata: ~

#============================= Elastic Cloud ==================================

Expand Down
1 change: 1 addition & 0 deletions libbeat/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
#
#processors:
#- add_docker_metadata: ~
#- add_host_metadata: ~

#============================= Elastic Cloud ==================================

Expand Down
1 change: 1 addition & 0 deletions libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
_ "github.com/elastic/beats/libbeat/processors/actions"
_ "github.com/elastic/beats/libbeat/processors/add_cloud_metadata"
_ "github.com/elastic/beats/libbeat/processors/add_docker_metadata"
_ "github.com/elastic/beats/libbeat/processors/add_host_metadata"
_ "github.com/elastic/beats/libbeat/processors/add_kubernetes_metadata"
_ "github.com/elastic/beats/libbeat/processors/add_locale"

Expand Down
29 changes: 29 additions & 0 deletions libbeat/docs/processors-using.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The supported processors are:
* <<include-fields,`include_fields`>>
* <<add-kubernetes-metadata,`add_kubernetes_metadata`>>
* <<add-docker-metadata,`add_docker_metadata`>>
* <<add-host-metadata,`add_host_metadata`>>

[[conditions]]
==== Conditions
Expand Down Expand Up @@ -657,3 +658,31 @@ for container ID. It defaults to 4 to match

`cleanup_timeout`:: (Optional) Time of inactivity to consider we can clean and
forget metadata for a container, 60s by default.


[[add-host-metadata]]
=== Add Host metadata

beta[]

The `add_host_metadata` processor annotates each event with relevant metadata from the host machine.
The fields added to the event are looking as following:

[source,json]
-------------------------------------------------------------------------------
{
"host":{
"architecture":"x86_64",
"hostname":"example-host",
"id":"",
"os":{
"family":"darwin",
"build":"16G1212",
"platform":"darwin",
"version":"10.12.6"
}
}
}
-------------------------------------------------------------------------------

NOTE: The host information is refreshed every 5 minutes.
34 changes: 34 additions & 0 deletions libbeat/processors/add_host_metadata/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- key: host
title: Host
description: >
Info collected for the host machine.
anchor: host-processor
fields:
- name: host
type: group
fields:
- name: hostname
type: keyword
description: >
Hostname.
- name: id
type: keyword
description: >
Unique host id.
- name: architecture
type: keyword
description: >
Host architecture (e.g. x86_64, arm, ppc, mips).
- name: os.platform
type: object
object_type: keyword
description: >
OS platform (e.g. centos, ubuntu, windows).
- name: os.version
type: object
description: >
OS version.
- name: os.family
type: object
description: >
OS family (e.g. redhat, debian, freebsd, windows).
Loading