# Geoip NOT WORKING HELP

**URL:** <https://discuss.elastic.co/t/geoip-not-working-help/143445>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 8, 2018, 7:48am UTC](https://discuss.elastic.co/t/geoip-not-working-help/143445 "2018-08-08T07:48:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leea](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@leea](https://discuss.elastic.co/u/leea)\
**Post date:** [August 8, 2018, 7:48am UTC](https://discuss.elastic.co/t/geoip-not-working-help/143445/1 "2018-08-08T07:48:11Z")

</div>

**Input.conf**  
input {  
beats{  
port =\> 5044  
type =\> "ioc"  
}  
beats{  
port =\> 5043  
type =\> "packetbeat"  
}  
beats{  
port =\> 5045  
type =\> "snort"  
}  
}

**logstash.conf**  
filter {  
date{  
match =\> ["timestamp", "dd/MM/yyy:HH:mm:ss Z"]  
}  
if [type] == "snort"{  
csv {  
separator =\> [","]  
columns =\> ["datetime","msg","proto","src\_ip","src\_port","dst\_ip","dst\_port","priority"]  
}  
geoip{  
source =\> "src\_ip "  
target =\> "geoip"  
database =\> "/home/fyp/Desktop/GeoLite2-City.mmdb"  
add\_field =\> ["[geoip][coordinates]", "%{[geoip][longitude]}"]  
add\_field =\> ["[geoip][coordinates]", "%{[geoip][latitude]}"]  
}  
mutate {  
convert =\> ["[geoip][coordinates]", "float"]  
}  
}  
else if [type] =="ioc"{  
csv{  
separator =\> [","]  
columns =\> ["name","value"]  
}  
}  
}

**output.conf**  
output {  
stdout { codec =\> "rubydebug" }  
if [type] == "snort" {  
elasticsearch{  
index =\> "snort"  
document\_type =\> "snort"  
}  
}  
else if [type] == "ioc"{  
elasticsearch{  
index =\> "ioc"  
document\_type =\> "ioc"  
}  
}  
else {  
elasticsearch{  
index =\> "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"  
pipeline =\> "geoip-info"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [August 8, 2018, 2:42pm UTC](https://discuss.elastic.co/t/geoip-not-working-help/143445/2 "2018-08-08T14:42:06Z")

</div>

@leea From what I see in your configuration and the title of your post 'GEOIP' I believe it's problem with Logstash.

Can you add a bit more details about your issue, the behavior you are experiencing and the expected results? Also adding Logstash, Beats and Elasticsearch version can help to narrow down your problem.

---

<div class="post-metadata">

**Author:** ![leea](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@leea](https://discuss.elastic.co/u/leea)\
**Post date:** [August 9, 2018, 1:27pm UTC](https://discuss.elastic.co/t/geoip-not-working-help/143445/3 "2018-08-09T13:27:03Z")

</div>

in kibana there is a \_geoip\_lookup\_failure and there are no geoip fields being shown  
ELK Version 6.2.4

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/7/67471bbbe8a1610dcc950ecc5c8ed385cb494ced.png)

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [August 9, 2018, 8:02pm UTC](https://discuss.elastic.co/t/geoip-not-working-help/143445/4 "2018-08-09T20:02:10Z")

</div>

@leea The "\_geoip\_lookup\_failure" is generated by the geoip in Logstash, by looking at your configuration I see that you are parsing the `src_ip` field from and the example you provide the value of the `src_ip` is `192.168.0.148`, this IP is from a private IP range. These IPs won't be resolvable by the geoip filter.

You can add a conditional in your filter block to skip them.

```auto
if [src_ip] !~ /^192.168./ {
geoip{
source => "src_ip "
target => "geoip"
database => "/home/fyp/Desktop/GeoLite2-City.mmdb"
add_field => ["[geoip][coordinates]", "%{[geoip][longitude]}"]
add_field => ["[geoip][coordinates]", "%{[geoip][latitude]}"]
}
}
```

---

<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:** [September 6, 2018, 8:02pm UTC](https://discuss.elastic.co/t/geoip-not-working-help/143445/5 "2018-09-06T20:02:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
