# GeoIP Field Selection

**URL:** <https://discuss.elastic.co/t/geoip-field-selection/145968>\
**Category:** Logstash\
**Created:** [August 24, 2018, 7:58pm UTC](https://discuss.elastic.co/t/geoip-field-selection/145968 "2018-08-24T19:58:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [August 24, 2018, 7:58pm UTC](https://discuss.elastic.co/t/geoip-field-selection/145968/1 "2018-08-24T19:58:39Z")

</div>

Trying to figure out the syntax of the Geoip filter field option. It says it accepts an array but I don't understand how you format a group of unrelated strings inside of an array....at least going by the example linked to in the documentation.

I've tried `{"field1", "field2"}` and `{field1,field2}` but I keep getting an error in the logs saying it expects either a `#` or `=>` after the first option. Below is the error and my config, line 29 is the fields line:

`Failed to execute action {:id=>:CloudFlare, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Expected one of #, => at line 29, column 25`

```
  geoip {
    source => "ClientIP"
    fields => {city_name,country_code2,country_name,latitude,longitude,timezone}
  }
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 27, 2018, 6:15am UTC](https://discuss.elastic.co/t/geoip-field-selection/145968/2 "2018-08-27T06:15:04Z")

</div>

An array looks like this: `["item1", "item", ..., "itemN"]`

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [August 27, 2018, 3:26pm UTC](https://discuss.elastic.co/t/geoip-field-selection/145968/3 "2018-08-27T15:26:50Z")

</div>

bah....I was misreading the array example in documentation.

---

<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 24, 2018, 3:26pm UTC](https://discuss.elastic.co/t/geoip-field-selection/145968/4 "2018-09-24T15:26:52Z")

</div>

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