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

Rename shipper config to beat #1165

Closed
wants to merge 1 commit into from
Closed
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 @@ -17,6 +17,7 @@ https://github.com/elastic/beats/compare/v1.1.2...master[Check the HEAD diff]
- Some publisher options refactoring in libbeat {pull}684[684]
- Run function to start a beat no returns an error instead of directly exiting. {pull}771[771]
- Move event preprocessor applying GeoIP to packetbeat {pull}772[772]
- shipper.* config was renamed to beat.* config. shipper is still available but deprecated.

*Packetbeat*
- Rename output fields in the dns package. Former flag `recursion_allowed` becomes `recursion_available`. {pull}803[803]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Contains common fields available in all event types.

==== beat.name

The name of the Beat sending the log messages. If the shipper name is set in the configuration file, then that value is used. If it is not set, the hostname is used.
The name of the Beat sending the log messages. If the beat name is set in the configuration file, then that value is used. If it is not set, the hostname is used.


==== beat.hostname
Expand Down
2 changes: 1 addition & 1 deletion filebeat/docs/reference/configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ configuration settings, you need to restart Filebeat to pick up the changes.
* <<kafka-output>>
* <<file-output>>
* <<console-output>>
* <<configuration-shipper>>
* <<configuration-beat>>
* <<configuration-logging>>
* <<configuration-run-options>>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ The following example configures Filebeat to ignore all the files that have a `g
A list of tags that the Beat includes in the `tags` field of each published
event. Tags make it easy to select specific events in Kibana or apply
conditional filtering in Logstash. These tags will be appended to the list of
tags specified in the `shipper` configuration.
tags specified in the `beat` configuration.

Example:

Expand All @@ -120,7 +120,7 @@ data. Fields can be scalar values, arrays, dictionaries, or any nested
combination of these. By default, the fields that you specify here will be
grouped under a `fields` sub-dictionary in the output document. To store the
custom fields as top-level fields, set the `fields_under_root` option to true.
If a duplicate field is declared in the `shipper` configuration, then its value
If a duplicate field is declared in the `beat` configuration, then its value
will be overwritten by the value declared here.

[source,yaml]
Expand Down Expand Up @@ -386,7 +386,7 @@ The `plain` encoding is special, because it does not validate or transform any i

include::../../../../libbeat/docs/outputconfig.asciidoc[]

include::../../../../libbeat/docs/shipperconfig.asciidoc[]
include::../../../../libbeat/docs/beatconfig.asciidoc[]

include::../../../../libbeat/docs/loggingconfig.asciidoc[]

Expand Down
2 changes: 1 addition & 1 deletion filebeat/etc/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
fields:
- name: beat.name
description: >
The name of the Beat sending the log messages. If the shipper name is set
The name of the Beat sending the log messages. If the beat name is set
in the configuration file, then that value is used. If it is not set,
the hostname is used.

Expand Down
18 changes: 9 additions & 9 deletions filebeat/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ output:
#pretty: false


############################# Shipper #########################################
############################# Beat #########################################

shipper:
# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
beat:
# The name of the beat that publishes the network data. It can be used to group
# all the transactions sent by a single beat in the web interface.
# If this options is not defined, the hostname is used.
#name:

# The tags of the shipper are included in their own field with each
# The tags of the beat are included in their own field with each
# transaction published. Tags make it easy to group servers by different
# logical properties.
#tags: ["service-X", "web-tier"]
Expand All @@ -377,15 +377,15 @@ shipper:
#fields_under_root: false

# Uncomment the following if you want to ignore transactions created
# by the server on which the shipper is installed. This option is useful
# to remove duplicates if shippers are installed on multiple servers.
# by the server on which the beat is installed. This option is useful
# to remove duplicates if beat are installed on multiple servers.
#ignore_outgoing: true

# How often (in seconds) shippers are publishing their IPs to the topology map.
# How often (in seconds) beat are publishing their IPs to the topology map.
# The default is 10 seconds.
#refresh_topology_freq: 10

# Expiration time (in seconds) of the IPs published by a shipper to the topology map.
# Expiration time (in seconds) of the IPs published by a beat to the topology map.
# All the IPs will be deleted afterwards. Note, that the value must be higher than
# refresh_topology_freq. The default is 15 seconds.
#topology_expire: 15
Expand Down
16 changes: 8 additions & 8 deletions filebeat/tests/system/config/filebeat.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ filebeat:
registry_file: {{ beat.working_dir + '/' }}{{ registryFile|default(".filebeat")}}


############################# Shipper ############################################
shipper:
############################# Beat ############################################
beat:

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
# The name of the beat that publishes the data. It can be used to group
# all the transactions sent by a single beat in the web interface.
# If this options is not defined, the hostname is used.
name: {{shipperName}}
name: {{beatName}}

# The tags of the shipper are included in their own field with each
# The tags of the beat are included in their own field with each
# transaction published. Tags make it easy to group servers by different
# logical properties.
tags: [
Expand All @@ -79,8 +79,8 @@ shipper:


# Uncomment the following if you want to ignore transactions created
# by the server on which the shipper is installed. This option is useful
# to remove duplicates if shippers are installed on multiple servers.
# by the server on which the beat is installed. This option is useful
# to remove duplicates if beat are installed on multiple servers.
# ignore_outgoing: true


Expand Down
6 changes: 3 additions & 3 deletions filebeat/tests/system/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def test_custom_fields_under_root(self):

def test_beat_fields(self):
"""
Checks that it's possible to set a custom shipper name. Also
Checks that it's possible to set a custom beat name. Also
tests that beat.hostname has values.
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/test.log",
shipperName="testShipperName"
beatName="testBeatName"
)

with open(self.working_dir + "/test.log", "w") as f:
Expand All @@ -79,6 +79,6 @@ def test_beat_fields(self):

output = self.read_output()
doc = output[0]
assert doc["beat.name"] == "testShipperName"
assert doc["beat.name"] == "testBeatName"
assert doc["beat.hostname"] == socket.gethostname()
assert "fields" not in doc
25 changes: 20 additions & 5 deletions libbeat/beat/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ const (
type BeatConfig struct {
Output map[string]*ucfg.Config
Logging logp.Logging
Shipper publisher.ShipperConfig
Shipper *publisher.BeatConfig
Beat *publisher.BeatConfig
}

var printVersion *bool
Expand Down Expand Up @@ -218,16 +219,30 @@ func (b *Beat) LoadConfig() error {
// Disable stderr logging if requested by cmdline flag
logp.SetStderr()

logp.Debug("beat", "Initializing output plugins")
if b.Config.Beat != nil && b.Config.Shipper != nil {
return fmt.Errorf("beat and shipper are set in config. Only one can be enabled. shipper is deprecated, use beat.")
}

// Copy shipper to config to beat @deprecated
if b.Config.Shipper != nil {
logp.Warn("shipper config is deprecated. Please use beat instead.")
b.Config.Beat = b.Config.Shipper
}

if b.Config.Shipper.MaxProcs != nil {
maxProcs := *b.Config.Shipper.MaxProcs
// Inits object in case it is not set in the config as it is not required
if b.Config.Beat == nil {
b.Config.Beat = &publisher.BeatConfig{}
}

if b.Config.Beat.MaxProcs != nil {
maxProcs := *b.Config.Beat.MaxProcs
if maxProcs > 0 {
runtime.GOMAXPROCS(maxProcs)
}
}

pub, err := publisher.New(b.Name, b.Config.Output, b.Config.Shipper)
logp.Debug("beat", "Initializing output plugins")
pub, err := publisher.New(b.Name, b.Config.Output, *b.Config.Beat)
if err != nil {
return fmt.Errorf("error Initialising publisher: %v\n", err)
}
Expand Down
2 changes: 1 addition & 1 deletion libbeat/common/geolite.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func LoadGeoIPData(config Geoip) *libgeo.GeoIP {
geoipPaths = *config.Paths
}
if len(geoipPaths) == 0 {
logp.Info("GeoIP disabled: No paths were set under shipper.geoip.paths")
logp.Info("GeoIP disabled: No paths were set under beat.geoip.paths")
// disabled
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions libbeat/common/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// LocalIpAddrs finds the IP addresses of the hosts on which
// the shipper currently runs on.
// the beat currently runs on.
func LocalIpAddrs() ([]net.IP, error) {
var localIPAddrs = []net.IP{}
ipaddrs, err := net.InterfaceAddrs()
Expand All @@ -22,7 +22,7 @@ func LocalIpAddrs() ([]net.IP, error) {
}

// LocalIpAddrsAsStrings finds the IP addresses of the hosts on which
// the shipper currently runs on and returns them as an array of
// the beat currently runs on and returns them as an array of
// strings.
func LocalIpAddrsAsStrings(include_loopbacks bool) ([]string, error) {
var localIPAddrsStrings = []string{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@
//// Use the appropriate variables defined in the index.asciidoc file to
//// resolve Beat names: beatname_uc and beatname_lc.
//// Use the following include to pull this content into a doc file:
//// include::../../libbeat/docs/shipperconfig.asciidoc[]
//// include::../../libbeat/docs/beatconfig.asciidoc[]
//// Make sure this content appears below a level 2 heading.
//////////////////////////////////////////////////////////////////////////

[[configuration-shipper]]
=== Shipper
[[configuration-beat]]
=== Beat

The `shipper` section contains configuration options for the Beat and some
The `beat` section contains configuration options for the Beat and some
general settings that control its behaviour.

Here is an example configuration:

[source,yaml]
------------------------------------------------------------------------------
shipper:
# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
beat:
# The name of the beat that publishes the network data. It can be used to group
# all the transactions sent by a single beat in the web interface.
# If this options is not defined, the hostname is used.
#name:

# The tags of the shipper are included in their own field with each
# The tags of the beat are included in their own field with each
# transaction published. Tags make it easy to group servers by different
# logical properties.
tags: ["service-X", "web-tier"]

# Uncomment the following if you want to ignore transactions created
# by the server on which the shipper is installed. This option is useful
# to remove duplicates if shippers are installed on multiple servers.
# by the server on which the beat is installed. This option is useful
# to remove duplicates if beat are installed on multiple servers.
ignore_outgoing: true

# How often (in seconds) shippers are publishing their IPs to the topology map.
# How often (in seconds) beat are publishing their IPs to the topology map.
# The default is 10 seconds.
refresh_topology_freq: 10

# Expiration time (in seconds) of the IPs published by a shipper to the topology map.
# Expiration time (in seconds) of the IPs published by a beat to the topology map.
# All the IPs will be deleted afterwards. Note, that the value must be higher than
# refresh_topology_freq. The default is 15 seconds.
topology_expire: 15
Expand All @@ -54,14 +54,14 @@ shipper:

------------------------------------------------------------------------------

==== Shipper Options
==== Beat Options

You can specify the following options under the `shipper` section:
You can specify the following options under the `beat` section:

===== name

The name of the Beat. If this option is empty, the `hostname` of the server is
used. The name is included as the `shipper` field in each published transaction. You can
used. The name is included as the `beat` field in each published transaction. You can
use the name to group all transactions sent by a single Beat.

At startup, each Beat can publish its IP, port, and name to Elasticsearch. This information
Expand All @@ -81,8 +81,8 @@ Example:

[source,yaml]
------------------------------------------------------------------------------
shipper:
name: "my-shipper"
beat:
name: "my-beat"
------------------------------------------------------------------------------

===== tags
Expand All @@ -97,7 +97,7 @@ Example:

[source,yaml]
--------------------------------------------------------------------------------
shipper:
beat:
tags: ["my-service", "hardware", "test"]
--------------------------------------------------------------------------------

Expand All @@ -114,7 +114,7 @@ Example:

[source,yaml]
------------------------------------------------------------------------------
shipper:
beat:
fields: {project: "myproject", instance-id: "574734885120952459"}
------------------------------------------------------------------------------

Expand All @@ -129,7 +129,7 @@ Example:

[source,yaml]
------------------------------------------------------------------------------
shipper:
beat:
fields_under_root: true
fields:
instance_id: i-10a64379
Expand Down
4 changes: 2 additions & 2 deletions libbeat/docs/installing-beats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
////////////////////////////////////////////////////////////////////
///// The content about individual configuration options has been
///// moved to the following files:
///// shipperconfig.asciidoc for Shipper options
///// beatconfig.asciidoc for Beat options
///// outputconfig.asciidoc for Output options
///// loggingconfig.asciidoc for Logging options
///// runconfig.asciidoc for Run Configuration options
///// The content now appears in the guides for each Beat. You can
///// include the content in the guide for your Beat by using the
///// following asciidoc include statements:
///// include::../../libbeat/docs/outputconfig.asciidoc[]
///// include::../../libbeat/docs/shipperconfig.asciidoc[]
///// include::../../libbeat/docs/beatconfig.asciidoc[]
///// include::../../libbeat/docs/loggingconfig.asciidoc[]
///// include::../../libbeat/docs/runconfig.asciidoc[]
////////////////////////////////////////////////////////////////////
Expand Down
18 changes: 9 additions & 9 deletions libbeat/etc/libbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ output:
#pretty: false


############################# Shipper #########################################
############################# Beat #########################################

shipper:
# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
beat:
# The name of the beat that publishes the network data. It can be used to group
# all the transactions sent by a single beat in the web interface.
# If this options is not defined, the hostname is used.
#name:

# The tags of the shipper are included in their own field with each
# The tags of the beat are included in their own field with each
# transaction published. Tags make it easy to group servers by different
# logical properties.
#tags: ["service-X", "web-tier"]
Expand All @@ -205,15 +205,15 @@ shipper:
#fields_under_root: false

# Uncomment the following if you want to ignore transactions created
# by the server on which the shipper is installed. This option is useful
# to remove duplicates if shippers are installed on multiple servers.
# by the server on which the beat is installed. This option is useful
# to remove duplicates if beat are installed on multiple servers.
#ignore_outgoing: true

# How often (in seconds) shippers are publishing their IPs to the topology map.
# How often (in seconds) beat are publishing their IPs to the topology map.
# The default is 10 seconds.
#refresh_topology_freq: 10

# Expiration time (in seconds) of the IPs published by a shipper to the topology map.
# Expiration time (in seconds) of the IPs published by a beat to the topology map.
# All the IPs will be deleted afterwards. Note, that the value must be higher than
# refresh_topology_freq. The default is 15 seconds.
#topology_expire: 15
Expand Down
Loading