# Geoip for using maps

**URL:** <https://discuss.elastic.co/t/geoip-for-using-maps/266592>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 8, 2021, 5:40pm UTC](https://discuss.elastic.co/t/geoip-for-using-maps/266592 "2021-03-08T17:40:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Mohamad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mohamad/32/85090_2.png) [@David\_Mohamad](https://discuss.elastic.co/u/David_Mohamad)\
**Post date:** [March 8, 2021, 5:40pm UTC](https://discuss.elastic.co/t/geoip-for-using-maps/266592/1 "2021-03-08T17:40:32Z")

</div>

Hi everyone,

I'm trying to use geoip to show data on a map. The problem is that the wrong index is showing up. I tried adding a new index template with no luck.

This is what I get when I check the json code:

> "src": {  
> "geo": {  
> "continent\_name": "Europe",  
> "country\_iso\_code": "RU",  
> "country\_name": "Russia",  
> "location": {  
> "lon": 37.6068,  
> "lat": 55.7386  
> }  
> },  
> "ip": "12.69.132.123"  
> }

I added these two lines in my filebeat.yml:

> setup.template.name: "logstash"  
> setup.template.pattern: "logstash-\*"

This is the template I use:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/9/c98f34aba1fac7363f5408cbd60dd954efea0576.png)

```
{
  "_doc": {
    "_routing": {
      "required": false
    },
    "numeric_detection": false,
    "dynamic_date_formats": [
      "strict_date_optional_time",
      "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
    ],
    "dynamic": true,
    "_source": {
      "excludes": [],
      "includes": [],
      "enabled": true
    },
    "dynamic_templates": [
      {
        "message_field": {
          "path_match": "message",
          "mapping": {
            "norms": false,
            "type": "text"
          },
          "match_mapping_type": "string"
        }
      },
      {
        "string_fields": {
          "mapping": {
            "norms": false,
            "type": "text",
            "fields": {
              "keyword": {
                "ignore_above": 256,
                "type": "keyword"
              }
            }
          },
          "match_mapping_type": "string",
          "match": "*"
        }
      }
    ],
    "date_detection": true,
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "geoip": {
        "dynamic": true,
        "type": "object",
        "properties": {
          "ip": {
            "type": "ip"
          },
          "latitude": {
            "type": "half_float"
          },
          "location": {
            "type": "geo_point"
          },
          "longitude": {
            "type": "half_float"
          }
        }
      },
      "@version": {
        "type": "keyword"
      }
    }
  }
}

```

Been looking for a solution for a while so any help will be appreciated.  
Thanks in advance.

---

<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:** [April 5, 2021, 7:40pm UTC](https://discuss.elastic.co/t/geoip-for-using-maps/266592/2 "2021-04-05T19:40:47Z")

</div>

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