# Need some help with Geo Enrichment - SOLVED

**URL:** <https://discuss.elastic.co/t/need-some-help-with-geo-enrichment-solved/42340>\
**Category:** Logstash\
**Created:** [February 21, 2016, 5:16pm UTC](https://discuss.elastic.co/t/need-some-help-with-geo-enrichment-solved/42340 "2016-02-21T17:16:34Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Wayne\_Taylor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wayne_taylor/32/45984_2.png) [@Wayne\_Taylor](https://discuss.elastic.co/u/Wayne_Taylor)\
**Post date:** [February 23, 2016, 2:04am UTC](https://discuss.elastic.co/t/need-some-help-with-geo-enrichment-solved/42340/9 "2016-02-23T02:04:55Z")

</div>

Really need some help warkolm, banging my head on this one ☹

Here is what I've been able to do thus far:

1. Add in a filter mutate to split airport by the ',' so we now have an array from the string containing the latitude and longitude
2. Add in a filter mutate to add the fields called latitude and longitude defined as airport[0] and airport[1]
3. Then add in a filter mutate to convert them from string which is what natively is happening into a float
4. In filter mutate name the longitude and latitude as: [location][lon] & [location][lat]
5. In my output section I define manage\_template as true and pass in the template location and template\_override = true

When I run I get the following error: "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"Failed to parse mapping [_default_]: Mapping definition for [location] has unsupported parameters: [dynamic : true]", "caused\_by"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"Mapping definition for [location] has unsupported parameters: [dynamic : true]"}}}}, :level=\>:warn}

Here is the config  
input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:sqlserver://host:1433;Database=db"  
jdbc\_user =\> "user"  
jdbc\_password =\> "password"  
jdbc\_driver\_library =\> "/Users/wtaylor/Downloads/sqljdbc\_4.0/enu/sqljdbc4.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
statement =\> "SELECT top 5 \* from SALES where PURCHASE\_DATE\_ET = '2016-02-22' and STANDARD\_AMOUNT \> 0"  
}  
}

filter {  
translate {  
field =\> "destination\_airport\_code"  
dictionary\_path =\> "/Users/wtaylor/Downloads/logstash-2.2.2/bin/geocord.yaml"  
fallback =\> "unknown"  
destination=\> "airport"  
}  
}

filter {  
mutate {  
split =\> {"airport" =\> ","}  
}  
}

filter {  
mutate {  
add\_field =\> ["latitude","%{[airport[0]}"]  
add\_field =\> ["longitude","%{[airport[1]}"]  
}  
}

filter {  
mutate {  
convert =\> { "longitude" =\> "float" }  
convert =\> { "latitude" =\> "float" }  
}  
}

filter{  
mutate {  
rename =\> {  
"longitude" =\> "[location][lon]"  
"latitude" =\> "[location][lat]"  
}  
}  
}

output {  
stdout { codec =\> json\_lines }

elasticsearch {  
index =\> "bre"  
document\_type =\> "purchase"  
manage\_template =\> true  
template =\> "/Users/wtaylor/Downloads/logstash-2.2.2/bin/template.json"  
template\_overwrite=\>"true"  
}  
}

My Template Json looks like:  
{  
"template" : "bre",  
"settings" : {  
"index.refresh\_interval" : "5s"  
},  
"mappings" : {  
"_default_" : {  
"\_all" : {"enabled" : true, "omit\_norms" : true},  
"properties" : {  
"@timestamp": { "type": "date", "doc\_values" : true },  
"@version": { "type": "string", "index": "not\_analyzed", "doc\_values" : true },  
"location" : {  
"type" : "geo\_point",  
"dynamic": true,  
"doc\_values" : true,  
"lat\_lon": true  
},  
"geoip" : {  
"type" : "object",  
"dynamic": true,  
"properties" : {  
"ip": { "type": "ip", "doc\_values" : true },  
"latitude" : { "type" : "float", "doc\_values" : true },  
"longitude" : { "type" : "float", "doc\_values" : true }  
}  
}

```
  }
}

```

}  
}

---

_[View the full topic](https://discuss.elastic.co/t/need-some-help-with-geo-enrichment-solved/42340)._
