# Can't using Geoip Apache2

**URL:** <https://discuss.elastic.co/t/cant-using-geoip-apache2/117588>\
**Category:** Logstash\
**Created:** [January 30, 2018, 9:20am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588 "2018-01-30T09:20:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vi\_t\_Dung\_Vu](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@Vi\_t\_Dung\_Vu](https://discuss.elastic.co/u/Vi_t_Dung_Vu)\
**Post date:** [January 30, 2018, 9:20am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/1 "2018-01-30T09:20:15Z")

</div>

I can't found apache2.access.geoip.location in Management \>\> Index Patterns \>\> fields

This is my filer file

```
> filter {

```

> ```
> if [type] == "apache_access" {
> 
> grok {
> match => { "message" => ["%{IPORHOST:[apache2][access][remote_ip]} - %{DATA:[apache2][access][user_name]} \[%{HTTPDATE:[apache2][access][time]}\] \"%{WORD:[apache2][access][method]} %{DATA:[apache2][access][url]} HTTP/%{NUMBER:[apache2][access][http_version]}\" %{NUMBER:[apache2][access][response_code]} %{NUMBER:[apache2][access][body_sent][bytes]}( \"%{DATA:[apache2][access][referrer]}\")?( \"%{DATA:[apache2][access][agent]}\")?",
> "%{IPORHOST:[apache2][access][remote_ip]} - %{DATA:[apache2][access][user_name]} \\[%{HTTPDATE:[apache2][access][time]}\\] \"-\" %{NUMBER:[apache2][access][response_code]} -" ] }
> 
> match => { "message" => ["%{IPORHOST:[apache2][access][remote_ip]} - %{DATA:[apache2][access][user_name]} \[%{HTTPDATE:[apache2][access][time]}\] \"%{WORD:[apache2][access][method]} %{DATA:[apache2][access][url]} HTTP/%{NUMBER:[apache2][access][http_version]}\" %{NUMBER:[apache2][access][response_code]} - ( \"%{DATA:[apache2][access][referrer]}\")?( \"%{DATA:[apache2][access][agent]}\")?",
> "%{IPORHOST:[apache2][access][remote_ip]} - %{DATA:[apache2][access][user_name]} \\[%{HTTPDATE:[apache2][access][time]}\\] \"-\" %{NUMBER:[apache2][access][response_code]} -" ] }
> 
> remove_field => "message"
> }
> mutate {
> add_field => { "read_timestamp" => "%{@timestamp}" }
> }
> date {
> match => ["[apache2][access][time]", "dd/MMM/YYYY:H:m:s Z" ]
> remove_field => "[apache2][access][time]"
> }
> useragent {
> source => "[apache2][access][agent]"
> target => "[apache2][access][user_agent]"
> remove_field => "[apache2][access][agent]"
> }
> geoip {
> source => "[apache2][access][remote_ip]"
> target => "[apache2][access][geoip]"
> }
> 
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 30, 2018, 9:21am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/2 "2018-01-30T09:21:43Z")

</div>

> [@Vi\_t\_Dung\_Vu](#):
>
> I can't found apache2.access.geoip.location in Management \>\> Index Patterns \>\> fields

You mean it hasn't created the field?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 30, 2018, 9:23am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/3 "2018-01-30T09:23:00Z")

</div>

Have you refreshed the index pattern? Can you show a document that has been indexed?

---

<div class="post-metadata">

**Author:** ![Vi\_t\_Dung\_Vu](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@Vi\_t\_Dung\_Vu](https://discuss.elastic.co/u/Vi_t_Dung_Vu)\
**Post date:** [January 30, 2018, 9:28am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/4 "2018-01-30T09:28:20Z")

</div>

i've been refresh it

---

<div class="post-metadata">

**Author:** ![Vi\_t\_Dung\_Vu](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@Vi\_t\_Dung\_Vu](https://discuss.elastic.co/u/Vi_t_Dung_Vu)\
**Post date:** [January 30, 2018, 9:31am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/5 "2018-01-30T09:31:32Z")

</div>

i can't found apache2.access.geoip.location however i found apache2.access.geoip.location.lon and apache2.access.geoip.location.lat

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 30, 2018, 9:36am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/6 "2018-01-30T09:36:06Z")

</div>

I suspect means that you do not have an [index template](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-templates.html) in place that maps `apache2.access.geoip.location` as a geo\_point, which means that the mapping is not correct. You need to create (or update) an index template that provides this mapping, and then reindex the data into a new index so this mapping change takes effect.

---

<div class="post-metadata">

**Author:** ![Vi\_t\_Dung\_Vu](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@Vi\_t\_Dung\_Vu](https://discuss.elastic.co/u/Vi_t_Dung_Vu)\
**Post date:** [January 30, 2018, 9:58am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/7 "2018-01-30T09:58:38Z")

</div>

Hi @Christian_Dahlqvist,  
what does that mean? Please guide me!

---

<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:** [February 27, 2018, 10:12am UTC](https://discuss.elastic.co/t/cant-using-geoip-apache2/117588/8 "2018-02-27T10:12:15Z")

</div>

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