1
1
---
2
- description : Look up Geo data from IP
2
+ description : Look up Geo data from IP.
3
3
---
4
4
5
- # GeoIP2 Filter
5
+ # GeoIP2 filter
6
6
7
- GeoIP2 Filter allows you to enrich the incoming data stream using location data from GeoIP2 database.
7
+ The GeoIP2 filter lets you enrich the incoming data stream with location data from the GeoIP2 database.
8
8
9
- ## Configuration Parameters <a id =" config " ></a >
9
+ The ` GeoLite2-City.mmdb ` database is available from [ MaxMind's official site] ( https://dev.maxmind.com/geoip/geoip2/geolite2/ ) .
10
+
11
+ ## Configuration parameters
10
12
11
13
This plugin supports the following configuration parameters:
12
14
13
15
| Key | Description |
14
16
| :--- | :--- |
15
- | database | Path to the GeoIP2 database. |
16
- | lookup \_ key | Field name to process |
17
- | record | Defines the ` KEY LOOKUP_KEY VALUE ` triplet. See below for how to set up this option . |
17
+ | ` database ` | Path to the GeoIP2 database. |
18
+ | ` lookup_key ` | Field name to process. |
19
+ | ` record ` | Defines the ` KEY LOOKUP_KEY VALUE ` triplet. |
18
20
19
- ## Getting Started < a id = " getting_started " ></ a >
21
+ ## Get started
20
22
21
- The following configuration will process incoming ` remote_addr ` , and append country information retrieved from GeoLite2 database.
23
+ The following configuration processes the incoming ` remote_addr ` and appends country information retrieved from the GeoLite2 database.
22
24
23
- ``` text
25
+ ``` python
24
26
[INPUT ]
25
27
Name dummy
26
28
Dummy {" remote_addr" : " 8.8.8.8" }
@@ -38,17 +40,14 @@ The following configuration will process incoming `remote_addr`, and append coun
38
40
Match *
39
41
```
40
42
41
- Each ` Record ` parameter above specifies the following triplet:
43
+ Each ` Record ` parameter specifies the following triplet:
42
44
43
- 1 . The field name to be added to records \( ` country ` \)
44
- 2 . The lookup key to process \( ` remote_addr ` \)
45
- 3 . The query for GeoIP2 database \( ` %{country.names.en} ` \)
45
+ - ` country ` : The field name to be added to records.
46
+ - ` remote_addr ` : The lookup key to process.
47
+ - ` %{country.names.en} ` : The GeoIP2 database query.
46
48
47
- By running Fluent Bit with the configuration above , you will see the following output:
49
+ By running Fluent Bit with this configuration, you will see the following output:
48
50
49
51
``` javascript
50
52
{" remote_addr" : " 8.8.8.8" , " country" : " United States" , " isocode" : " US" }
51
53
```
52
-
53
- Note that the ` GeoLite2-City.mmdb ` database is available from [ MaxMind's official site] ( https://dev.maxmind.com/geoip/geoip2/geolite2/ ) .
54
-
0 commit comments