Skip to content

Commit eb2a795

Browse files
committed
Drop the copied examples, the geoip examples suffice
1 parent 6ff9430 commit eb2a795

File tree

1 file changed

+0
-241
lines changed

1 file changed

+0
-241
lines changed

docs/reference/ingest/processors/ip-location.asciidoc

Lines changed: 0 additions & 241 deletions
Original file line numberDiff line numberDiff line change
@@ -225,244 +225,3 @@ Which returns:
225225
}
226226
--------------------------------------------------
227227
// TESTRESPONSE[s/"_seq_no" : \d+/"_seq_no" : $body._seq_no/ s/"_primary_term" : 1/"_primary_term" : $body._primary_term/]
228-
229-
[[ingest-geoip-mappings-note]]
230-
===== Recognizing Location as a Geopoint
231-
Although this processor enriches your document with a `location` field containing
232-
the estimated latitude and longitude of the IP address, this field will not be
233-
indexed as a {ref}/geo-point.html[`geo_point`] type in Elasticsearch without explicitly defining it
234-
as such in the mapping.
235-
236-
You can use the following mapping for the example index above:
237-
238-
[source,console]
239-
--------------------------------------------------
240-
PUT my_ip_locations
241-
{
242-
"mappings": {
243-
"properties": {
244-
"ip_location": {
245-
"properties": {
246-
"location": { "type": "geo_point" }
247-
}
248-
}
249-
}
250-
}
251-
}
252-
--------------------------------------------------
253-
254-
////
255-
[source,console]
256-
--------------------------------------------------
257-
PUT _ingest/pipeline/ip_location
258-
{
259-
"description" : "Add ip geolocation info",
260-
"processors" : [
261-
{
262-
"ip_location" : {
263-
"field" : "ip"
264-
}
265-
}
266-
]
267-
}
268-
269-
PUT my_ip_locations/_doc/1?refresh=true&pipeline=ip_location
270-
{
271-
"ip": "89.160.20.128"
272-
}
273-
274-
GET /my_ip_locations/_search
275-
{
276-
"query": {
277-
"bool": {
278-
"must": {
279-
"match_all": {}
280-
},
281-
"filter": {
282-
"geo_distance": {
283-
"distance": "1m",
284-
"geoip.location": {
285-
"lon": 15.6167,
286-
"lat": 58.4167
287-
}
288-
}
289-
}
290-
}
291-
}
292-
}
293-
--------------------------------------------------
294-
// TEST[continued]
295-
296-
[source,console-result]
297-
--------------------------------------------------
298-
{
299-
"took" : 3,
300-
"timed_out" : false,
301-
"_shards" : {
302-
"total" : 1,
303-
"successful" : 1,
304-
"skipped" : 0,
305-
"failed" : 0
306-
},
307-
"hits" : {
308-
"total" : {
309-
"value": 1,
310-
"relation": "eq"
311-
},
312-
"max_score" : 1.0,
313-
"hits" : [
314-
{
315-
"_index" : "my_ip_locations",
316-
"_id" : "1",
317-
"_score" : 1.0,
318-
"_source" : {
319-
"ip_location" : {
320-
"continent_name" : "Europe",
321-
"country_name" : "Sweden",
322-
"country_iso_code" : "SE",
323-
"city_name" : "Linköping",
324-
"region_iso_code" : "SE-E",
325-
"region_name" : "Östergötland County",
326-
"location" : {
327-
"lon" : 15.6167,
328-
"lat" : 58.4167
329-
}
330-
},
331-
"ip" : "89.160.20.128"
332-
}
333-
}
334-
]
335-
}
336-
}
337-
--------------------------------------------------
338-
// TESTRESPONSE[s/"took" : 3/"took" : $body.took/]
339-
////
340-
341-
[[manage-geoip-database-updates]]
342-
==== Manage your own IP geolocation database updates
343-
344-
If you can't <<geoip-automatic-updates,automatically update>> your IP geolocation databases
345-
from the Elastic endpoint, you have a few other options:
346-
347-
* <<use-proxy-geoip-endpoint,Use a proxy endpoint>>
348-
* <<use-custom-geoip-endpoint,Use a custom endpoint>>
349-
* <<manually-update-geoip-databases,Manually update your IP geolocation databases>>
350-
351-
[[use-proxy-geoip-endpoint]]
352-
**Use a proxy endpoint**
353-
354-
If you can't connect directly to the Elastic GeoIP endpoint, consider setting up
355-
a secure proxy. You can then specify the proxy endpoint URL in the
356-
<<ingest-geoip-downloader-endpoint,`ingest.geoip.downloader.endpoint`>> setting
357-
of each node’s `elasticsearch.yml` file.
358-
359-
In a strict setup the following domains may need to be added to the allowed
360-
domains list:
361-
362-
* `geoip.elastic.co`
363-
* `storage.googleapis.com`
364-
365-
[[use-custom-geoip-endpoint]]
366-
**Use a custom endpoint**
367-
368-
You can create a service that mimics the Elastic GeoIP endpoint. You can then
369-
get automatic updates from this service.
370-
371-
. Download your `.mmdb` database files from the
372-
http://dev.maxmind.com/geoip/geoip2/geolite2[MaxMind site].
373-
374-
. Copy your database files to a single directory.
375-
376-
. From your {es} directory, run:
377-
+
378-
[source,sh]
379-
----
380-
./bin/elasticsearch-geoip -s my/source/dir [-t target/directory]
381-
----
382-
383-
. Serve the static database files from your directory. For example, you can use
384-
Docker to serve the files from an nginx server:
385-
+
386-
[source,sh]
387-
----
388-
docker run -v my/source/dir:/usr/share/nginx/html:ro nginx
389-
----
390-
391-
. Specify the service's endpoint URL in the
392-
<<ingest-geoip-downloader-endpoint,`ingest.geoip.downloader.endpoint`>> setting
393-
of each node’s `elasticsearch.yml` file.
394-
+
395-
By default, {es} checks the endpoint for updates every three days. To use
396-
another polling interval, use the <<cluster-update-settings,cluster update
397-
settings API>> to set
398-
<<ingest-geoip-downloader-poll-interval,`ingest.geoip.downloader.poll.interval`>>.
399-
400-
[[manually-update-geoip-databases]]
401-
**Manually update your IP geolocation databases**
402-
403-
. Use the <<cluster-update-settings,cluster update settings API>> to set
404-
`ingest.geoip.downloader.enabled` to `false`. This disables automatic updates
405-
that may overwrite your database changes. This also deletes all downloaded
406-
databases.
407-
408-
. Download your `.mmdb` database files from the
409-
http://dev.maxmind.com/geoip/geoip2/geolite2[MaxMind site].
410-
+
411-
You can also use custom city, country, and ASN `.mmdb` files. These files must
412-
be uncompressed. The type (city, country, or ASN) will be pulled from the file
413-
metadata, so the filename does not matter.
414-
415-
. On {ess} deployments upload database using
416-
a {cloud}/ec-custom-bundles.html[custom bundle].
417-
418-
. On self-managed deployments copy the database files to `$ES_CONFIG/ingest-geoip`.
419-
420-
. In your `geoip` processors, configure the `database_file` parameter to use a
421-
custom database file.
422-
423-
[[ingest-geoip-settings]]
424-
===== Node Settings
425-
426-
The `geoip` processor supports the following setting:
427-
428-
`ingest.geoip.cache_size`::
429-
430-
The maximum number of results that should be cached. Defaults to `1000`.
431-
432-
Note that these settings are node settings and apply to all `geoip` and `ip_location` processors, i.e. there is a single cache for all such processors.
433-
434-
[[geoip-cluster-settings]]
435-
===== Cluster settings
436-
437-
[[ingest-geoip-downloader-enabled]]
438-
`ingest.geoip.downloader.enabled`::
439-
(<<dynamic-cluster-setting,Dynamic>>, Boolean)
440-
If `true`, {es} automatically downloads and manages updates for IP geolocation databases
441-
from the `ingest.geoip.downloader.endpoint`. If `false`, {es} does not download
442-
updates and deletes all downloaded databases. Defaults to `true`.
443-
444-
[[ingest-geoip-downloader-eager-download]]
445-
`ingest.geoip.downloader.eager.download`::
446-
(<<dynamic-cluster-setting,Dynamic>>, Boolean)
447-
If `true`, {es} downloads IP geolocation databases immediately, regardless of whether a
448-
pipeline exists with a geoip processor. If `false`, {es} only begins downloading
449-
the databases if a pipeline with a geoip processor exists or is added. Defaults
450-
to `false`.
451-
452-
[[ingest-geoip-downloader-endpoint]]
453-
`ingest.geoip.downloader.endpoint`::
454-
(<<static-cluster-setting,Static>>, string)
455-
Endpoint URL used to download updates for IP geolocation databases. For example, `https://myDomain.com/overview.json`.
456-
Defaults to `https://geoip.elastic.co/v1/database`. {es} stores downloaded database files in
457-
each node's <<es-tmpdir,temporary directory>> at `$ES_TMPDIR/geoip-databases/<node_id>`.
458-
Note that {es} will make a GET request to `${ingest.geoip.downloader.endpoint}?elastic_geoip_service_tos=agree`,
459-
expecting the list of metadata about databases typically found in `overview.json`.
460-
461-
The downloader uses the JDK's builtin cacerts. If you're using a custom endpoint, add the custom https endpoint cacert(s) to the JDK's truststore.
462-
463-
[[ingest-geoip-downloader-poll-interval]]
464-
`ingest.geoip.downloader.poll.interval`::
465-
(<<dynamic-cluster-setting,Dynamic>>, <<time-units,time value>>)
466-
How often {es} checks for IP geolocation database updates at the
467-
`ingest.geoip.downloader.endpoint`. Must be greater than `1d` (one day). Defaults
468-
to `3d` (three days).

0 commit comments

Comments
 (0)