Skip to content

Commit 8d716e0

Browse files
committed
Use client_geoip.location for the GeoIP location of the client_ip (elastic#2795)
This information is available if you use the GeoIP processor from the Ingest GeoIP Processor Plugin. (cherry picked from commit 17758fc)
1 parent 1f86779 commit 8d716e0

File tree

8 files changed

+55
-12
lines changed

8 files changed

+55
-12
lines changed

CHANGELOG.asciidoc

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ https://github.com/elastic/beats/compare/v5.0.0...5.0[Check the HEAD diff]
6060
- Add system core metricset for Windows. {pull}2883}[2883]
6161

6262
*Packetbeat*
63+
- Define `client_geoip.location` as geo_point in the mappings to be used by the GeoIP processor in the Ingest Node pipeline.
64+
{pull}2795[2795]
6365

6466
*Topbeat*
6567

packetbeat/docs/fields.asciidoc

+17-1
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,23 @@ type: geo_point
10691069

10701070
example: 40.715, -74.011
10711071

1072-
The GeoIP location of the `real_ip` IP address or of the `client_ip` address if the `real_ip` is disabled. The field is a string containing the latitude and longitude separated by a comma.
1072+
DEPRECATED. Please use `client_geoip` instead. The GeoIP location of the `real_ip` IP address or of the `client_ip` address if the `real_ip` is disabled. The field is a string containing the latitude and longitude separated by a comma.
1073+
1074+
1075+
[float]
1076+
== client_geoip Fields
1077+
1078+
The GeoIP information of the client.
1079+
1080+
1081+
[float]
1082+
=== client_geoip.location
1083+
1084+
type: geo_point
1085+
1086+
example: {'lat': 51, 'lon': 9}
1087+
1088+
The GeoIP location of the `client_ip` address. This field is available only if you define a https://www.elastic.co/guide/en/elasticsearch/plugins/master/using-ingest-geoip.html[GeoIP Processor] as a pipeline in the https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest-geoip.html[Ingest GeoIP processor plugin] or using Logstash.
10731089

10741090

10751091
[float]

packetbeat/docs/reference/configuration/packetbeat-options.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,7 @@ The default is false.
468468
The header field to extract the real IP from. This setting is useful when
469469
you want to capture traffic behind a reverse proxy, but you want to get the geo-location
470470
information. If this header is present and contains a valid IP addresses, the
471-
information is used for the `real_ip` and `client_location` indexed
472-
fields.
471+
information is used for the `real_ip` field.
473472

474473
===== max_message_size
475474

packetbeat/etc/fields.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,24 @@
4343

4444
- name: client_location
4545
type: geo_point
46-
example: "40.715, -74.011"
46+
example: 40.715, -74.011
4747
description: >
48-
The GeoIP location of the `real_ip` IP address or of the
49-
`client_ip` address if the `real_ip` is disabled. The field is a string
50-
containing the latitude and longitude separated by a comma.
48+
DEPRECATED. Please use `client_geoip` instead.
49+
The GeoIP location of the `real_ip` IP address or of the `client_ip` address if the `real_ip` is
50+
disabled. The field is a string containing the latitude and longitude separated by a comma.
51+
52+
- name: client_geoip
53+
description: The GeoIP information of the client.
54+
type: group
55+
fields:
56+
- name: location
57+
type: geo_point
58+
example: {lat: 51, lon: 9}
59+
description: >
60+
The GeoIP location of the `client_ip` address. This field is available
61+
only if you define a
62+
https://www.elastic.co/guide/en/elasticsearch/plugins/master/using-ingest-geoip.html[GeoIP Processor] as a pipeline in the
63+
https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest-geoip.html[Ingest GeoIP processor plugin] or using Logstash.
5164
5265
- name: client_port
5366
description: >

packetbeat/etc/kibana/index-pattern/packetbeat.json

+1-1
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"visState": "{\"title\":\"New Visualization\",\"type\":\"tile_map\",\"params\":{\"mapType\":\"Scaled Circle Markers\",\"isDesaturated\":true,\"addTooltip\":true,\"heatMaxZoom\":16,\"heatMinOpacity\":0.1,\"heatRadius\":25,\"heatBlur\":15,\"heatNormalizeData\":true,\"wms\":{\"enabled\":false,\"url\":\"https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WMSServer\",\"options\":{\"version\":\"1.3.0\",\"layers\":\"0\",\"format\":\"image/png\",\"transparent\":true,\"attribution\":\"Maps provided by USGS\",\"styles\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"geohash_grid\",\"schema\":\"segment\",\"params\":{\"field\":\"client_location\",\"autoPrecision\":true,\"precision\":2}}],\"listeners\":{}}",
2+
"visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"autoPrecision\":true,\"field\":\"client_geoip.location\"},\"schema\":\"segment\",\"type\":\"geohash_grid\"}],\"listeners\":{},\"params\":{\"addTooltip\":true,\"heatBlur\":15,\"heatMaxZoom\":16,\"heatMinOpacity\":0.1,\"heatNormalizeData\":true,\"heatRadius\":25,\"isDesaturated\":true,\"mapCenter\":[15,5],\"mapType\":\"Scaled Circle Markers\",\"mapZoom\":2,\"wms\":{\"enabled\":false,\"options\":{\"attribution\":\"Maps provided by USGS\",\"format\":\"image/png\",\"layers\":\"0\",\"styles\":\"\",\"transparent\":true,\"version\":\"1.3.0\"},\"url\":\"https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WMSServer\"}},\"title\":\"Client locations\",\"type\":\"tile_map\"}",
33
"description": "",
44
"title": "Client locations",
5-
"uiStateJSON": "{}",
5+
"uiStateJSON": "{\"mapCenter\":[0,-0.17578125]}",
66
"version": 1,
7-
"savedSearchId": "Packetbeat-Search",
87
"kibanaSavedObjectMeta": {
9-
"searchSourceJSON": "{\"filter\":[]}"
8+
"searchSourceJSON": "{\"index\":\"packetbeat-*\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[]}"
109
}
1110
}

packetbeat/packetbeat.template-es2x.json

+7
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,13 @@
573573
}
574574
}
575575
},
576+
"client_geoip": {
577+
"properties": {
578+
"location": {
579+
"type": "geo_point"
580+
}
581+
}
582+
},
576583
"client_ip": {
577584
"ignore_above": 1024,
578585
"index": "not_analyzed",

packetbeat/packetbeat.template.json

+7
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,13 @@
499499
}
500500
}
501501
},
502+
"client_geoip": {
503+
"properties": {
504+
"location": {
505+
"type": "geo_point"
506+
}
507+
}
508+
},
502509
"client_ip": {
503510
"ignore_above": 1024,
504511
"type": "keyword"

0 commit comments

Comments
 (0)