Skip to content
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
12 changes: 12 additions & 0 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,18 @@ type: keyword
Error type.


--

*`location`*::
+
--
type: keyword

required: False

Unique string representing the vantage point of this monitor.


--

[[exported-fields-cloud]]
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/include/fields.go

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,18 @@ type: keyword
Error type.


--

*`location`*::
+
--
type: keyword

required: False

Unique string representing the vantage point of this monitor.


--

[[exported-fields-cloud]]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ type: keyword
Error type.


--

*`location`*::
+
--
type: keyword

required: False

Unique string representing the vantage point of this monitor.


--

[[exported-fields-cloud]]
Expand Down
1 change: 1 addition & 0 deletions heartbeat/docs/heartbeat-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ Example configuration:

Also see <<configuration-ssl>> for a full description of the `ssl` options.


[float]
[[monitor-http-options]]
=== HTTP options
Expand Down
3 changes: 3 additions & 0 deletions heartbeat/heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ heartbeat.monitors:
# Total test connection and data exchange timeout
#timeout: 16s

location: minneapolis
geo.location: "44.8897,-93.3500"

#==================== Elasticsearch template setting ==========================

setup.template.settings:
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/include/fields.go

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions libbeat/_meta/fields.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@
type: keyword
description: >
Error type.

- name: location
required: false
type: keyword
description: >
Unique string representing the vantage point of this monitor.
2 changes: 2 additions & 0 deletions libbeat/common/mapstr.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type EventMetadata struct {
Fields MapStr
FieldsUnderRoot bool `config:"fields_under_root"`
Tags []string
Location string
GeoLocation string `config:"geo.location"`
}

// MapStr is a map[string]interface{} wrapper with utility methods for common
Expand Down
10 changes: 10 additions & 0 deletions libbeat/publisher/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ type pipelineProcessors struct {
builtinMeta common.MapStr
fields common.MapStr
tags []string
location string
geoLocation string

processors beat.Processor

Expand Down Expand Up @@ -435,6 +437,14 @@ func makePipelineProcessors(
p.tags = t
}

if annotations.Event.Location != "" {
p.location = annotations.Event.Location
}

if annotations.Event.GeoLocation != "" {
p.geoLocation = annotations.Event.GeoLocation
}

return p
}

Expand Down
12 changes: 12 additions & 0 deletions libbeat/publisher/pipeline/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ func newProcessorPipeline(
processors.add(makeAddTagsProcessor("tags", tags))
}

location := global.location
if config.EventMetadata.Location != "" {
location = config.EventMetadata.Location
}
processors.add(makeAddFieldsProcessor("location", common.MapStr{"location": location}, false))

geoLocation := global.geoLocation
if config.EventMetadata.GeoLocation != "" {
geoLocation = config.EventMetadata.GeoLocation
}
processors.add(makeAddFieldsProcessor("geo.location", common.MapStr{"geo": common.MapStr{"location": geoLocation}}, false))

// setup 3, 4, 5: client config fields + pipeline fields + client fields + dyn metadata
fields := config.Fields.Clone()
fields.DeepUpdate(global.fields.Clone())
Expand Down
12 changes: 12 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,18 @@ type: keyword
Error type.


--

*`location`*::
+
--
type: keyword

required: False

Unique string representing the vantage point of this monitor.


--

[[exported-fields-ceph]]
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/include/fields/fields.go

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions packetbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,18 @@ type: keyword
Error type.


--

*`location`*::
+
--
type: keyword

required: False

Unique string representing the vantage point of this monitor.


--

[[exported-fields-cassandra]]
Expand Down
2 changes: 1 addition & 1 deletion packetbeat/include/fields.go

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions winlogbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ type: keyword
Error type.


--

*`location`*::
+
--
type: keyword

required: False

Unique string representing the vantage point of this monitor.


--

[[exported-fields-cloud]]
Expand Down
2 changes: 1 addition & 1 deletion winlogbeat/include/fields.go

Large diffs are not rendered by default.