# Adding GeoIP using logstash

**URL:** https://discuss.elastic.co/t/adding-geoip-using-logstash/55621
**Category:** Logstash
**Created:** [July 15, 2016, 1:15pm UTC](https://discuss.elastic.co/t/adding-geoip-using-logstash/55621 "2016-07-15T13:15:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vishnubraj](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vishnubraj](https://discuss.elastic.co/u/vishnubraj)
#### Post date: [July 15, 2016, 1:15pm UTC](https://discuss.elastic.co/t/adding-geoip-using-logstash/55621/1 "2016-07-15T13:15:31Z")

</div>

Hi,

I am trying to add geoip detail for my data. I only want the longitude and latitude value.

I have the below filter config.

filter {  
if [label] == "edge" {  
geoip {  
source =\> "ip\_src"  
target =\> "sg"  
database =\> "/opt/logstash/GeoLiteCity.dat"  
fields =\> ["latitude", "longitude"]  
}  
geoip {  
source =\> "ip\_dst"  
target =\> "dg"  
database =\> "/opt/logstash/GeoLiteCity.dat"  
fields =\> ["latitude", "longitude"]  
}  
mutate {  
remove\_field =\> ["[sg][country\_code2]", "[sg][country\_name]", "[dg][country\_code2]", "[dg][country\_name]"]  
convert =\> ["[sg][latitude]", "float"]  
convert =\> ["[sg][longitude]", "float"]  
convert =\> ["[dg][latitude]", "float"]  
convert =\> ["[dg][longitude]", "float"]  
}  
}  
}

logstash thorughs an error saying [geoip] has unsupported parameters:

below are the logstash logs.

"type"=\>"nf", "sg"=\>{"latitude"=\>43.783199999999994, "longitude"=\>-111.7656}, "dg"=\>{"latitude"=\>37.44040000000001, "longitude"=\>-121.87049999999999}}, "ip\_dst"], "dg"=\>[{"ip\_src"=\>"205.185.99.106", "port\_dst"=\>80, "tos"=\>0, "tag"=\>0, "label"=\>"edge", "peer\_ip\_src"=\>"10.0.12.252", "as\_dst"=\>0, "as\_src"=\>209, "iface\_in"=\>57, "iface\_out"=\>29, "stamp\_inserted"=\>"2016-07-15 13:06:00", "ip\_dst"=\>"199.59.225.179", "tcp\_flags"=\>"26", "bytes"=\>1297, "port\_src"=\>1565, "ip\_proto"=\>"tcp", "stamp\_updated"=\>"2016-07-15 13:09:01", "packets"=\>4, "@version"=\>"1", "@timestamp"=\>"2016-07-15T13:09:01.391Z", "type"=\>"nf", "sg"=\>{"latitude"=\>43.783199999999994, "longitude"=\>-111.7656}, "dg"=\>{"latitude"=\>37.44040000000001, "longitude"=\>-121.87049999999999}}, "dg"], "[dg][latitude]"=\>[{"latitude"=\>37.44040000000001, "longitude"=\>-121.87049999999999}, "latitude"], "[dg][longitude]"=\>[{"latitude"=\>37.44040000000001, "longitude"=\>-121.87049999999999}, "longitude"], "[sg][country\_code2]"=\>[{"latitude"=\>43.783199999999994, "longitude"=\>-111.7656}, "country\_code2"], "[sg][country\_name]"=\>[{"latitude"=\>43.783199999999994, "longitude"=\>-111.7656}, "country\_name"], "[dg][country\_code2]"=\>[{"latitude"=\>37.44040000000001, "longitude"=\>-121.87049999999999}, "country\_code2"], "[dg][country\_name]"=\>[{"latitude"=\>37.44040000000001, "longitude"=\>-121.87049999999999}, "country\_name"]}\>\>], :response=\>{"index"=\>{"\_index"=\>"logs\_2016\_07\_15", "\_type"=\>"nf", "\_id"=\>nil, "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"Failed to parse mapping [_default_]: Mapping definition for [geoip] has unsupported parameters: [path : full]", "caused\_by"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"Mapping definition for [geoip] has unsupported parameters: [path : full]"}}}}, :level=\>:warn}

can anyone help me on this...

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [July 15, 2016, 1:19pm UTC](https://discuss.elastic.co/t/adding-geoip-using-logstash/55621/2 "2016-07-15T13:19:54Z")

</div>

Either upgrade your Logstash or start using an index template that doesn't include "path: full" for the `geoip` field. See [https://github.com/logstash-plugins/logstash-output-elasticsearch/commit/3b8920864ed09793a79bdb54ae1856d948a3a20c](https://github.com/logstash-plugins/logstash-output-elasticsearch/commit/3b8920864ed09793a79bdb54ae1856d948a3a20c).

---

<div class="post-metadata">

### Author: ![vishnubraj](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vishnubraj](https://discuss.elastic.co/u/vishnubraj)
#### Post date: [July 15, 2016, 8:07pm UTC](https://discuss.elastic.co/t/adding-geoip-using-logstash/55621/3 "2016-07-15T20:07:52Z")

</div>

Thanks Magnus.. Removing the "path:full" option fixed the issue.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 4:47am UTC](https://discuss.elastic.co/t/adding-geoip-using-logstash/55621/4 "2017-07-06T04:47:47Z")

</div>


