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

Cherry-pick #20811 to 7.9: Add missing country_name geo field in add host metadata #20817

Merged
merged 1 commit into from
Aug 27, 2020
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.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix `setup.dashboards.index` setting not working. {pull}17749[17749]
- Fix Elasticsearch license endpoint URL referenced in error message. {issue}17880[17880] {pull}18030[18030]
- Change `decode_json_fields` processor, to merge parsed json objects with existing objects in the event instead of fully replacing them. {pull}17958[17958]
- Add missing country_name geo field in `add_host_metadata` and `add_observer_metadata` processors. {issue}20796[20796] {pull}20811[20811]

*Auditbeat*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func TestConfigGeoEnabled(t *testing.T) {
"geo.name": "yerevan-am",
"geo.location": "40.177200, 44.503490",
"geo.continent_name": "Asia",
"geo.country_name": "Armenia",
"geo.country_iso_code": "AM",
"geo.region_name": "Erevan",
"geo.region_iso_code": "AM-ER",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func TestConfigGeoEnabled(t *testing.T) {
"geo.name": "yerevan-am",
"geo.location": "40.177200, 44.503490",
"geo.continent_name": "Asia",
"geo.country_name": "Armenia",
"geo.country_iso_code": "AM",
"geo.region_name": "Erevan",
"geo.region_iso_code": "AM-ER",
Expand Down
2 changes: 2 additions & 0 deletions libbeat/processors/util/geo.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type GeoConfig struct {
Name string `config:"name"`
Location string `config:"location"`
ContinentName string `config:"continent_name"`
CountryName string `config:"country_name"`
CountryISOCode string `config:"country_iso_code"`
RegionName string `config:"region_name"`
RegionISOCode string `config:"region_iso_code"`
Expand Down Expand Up @@ -59,6 +60,7 @@ func GeoConfigToMap(config GeoConfig) (common.MapStr, error) {
"name": config.Name,
"location": config.Location,
"continent_name": config.ContinentName,
"country_name": config.CountryName,
"country_iso_code": config.CountryISOCode,
"region_name": config.RegionName,
"region_iso_code": config.RegionISOCode,
Expand Down