Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 2.82 KB

host_metadata.md

File metadata and controls

59 lines (48 loc) · 2.82 KB

host_metadata operator

The host_metadata operator adds hostname and ip to the resource of incoming entries.

Configuration Fields

Field Default Description
id host_metadata A unique identifier for the operator
output Next in pipeline The connected operator(s) that will receive all outbound entries
include_hostname true Whether to set the hostname on the resource of incoming entries
include_ip true Whether to set the ip on the resource of incoming entries
on_error send The behavior of the operator if it encounters an error. See on_error
if An expression that, when set, will be evaluated to determine whether this parser should be used for the given entry. This allows you to do easy conditional parsing without branching logic with routers.

Example Configurations

Add static tags and labels

Configuration:

- type: host_metadata
  include_hostname: true
  include_ip: true
Input entry Output entry
{
  "timestamp": "2020-06-15T11:15:50.475364-04:00",
  "record": {
    "message": "test"
  }
}
{
  "timestamp": "2020-06-15T11:15:50.475364-04:00",
  "resource": {
    "hostname": "my_host",
    "ip": "0.0.0.0",
  },
  "record": {
    "message": "test"
  }
}