# How to get country name using LS filter

**URL:** <https://discuss.elastic.co/t/how-to-get-country-name-using-ls-filter/42146>\
**Category:** Logstash\
**Created:** [February 18, 2016, 2:12pm UTC](https://discuss.elastic.co/t/how-to-get-country-name-using-ls-filter/42146 "2016-02-18T14:12:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 18, 2016, 2:12pm UTC](https://discuss.elastic.co/t/how-to-get-country-name-using-ls-filter/42146/1 "2016-02-18T14:12:36Z")

</div>

Hi Guys,

I am aware that I can use `geoip { source => ...}` to get country name based on source IP . But My concern is I am getting less data on Map when I am using Geoip filter in LS . So what I have done is I used following in LS, as I already have long,lat fileds in the data.

```
  mutate {
        convert => {
            "slat" => "float"
            "slong" => "float"
        }
        add_field => {
            "[geoip][location]" => ["%{slong}", "%{slat}"]
            "[geoip][latitude]" => "%{slat}"
            "[geoip][longitude]" => "%{slong}"
        }

}

```

With this approach I am able to see data on Map but I am not getting country name out of it . I am also aware that I can use Geolight.city database for this but we do not want to spent money on this database .Please suggest if I can achieve this with above mentioned LS code ? Something like add another country field ?

Thanks  
VG

---

<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, 5:10am UTC](https://discuss.elastic.co/t/how-to-get-country-name-using-ls-filter/42146/2 "2017-07-06T05:10:52Z")

</div>


