# How can i set two geoip source fields?

**URL:** https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309
**Category:** Logstash
**Created:** [August 7, 2018, 11:22am UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309 "2018-08-07T11:22:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![med\_amine](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@med\_amine](https://discuss.elastic.co/u/med_amine)
#### Post date: [August 7, 2018, 11:22am UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/1 "2018-08-07T11:22:46Z")

</div>

hello,

i have two geoip sources the first is "clientip" and the second is "clientip\_e"  
so i use this syntax but nothing #it's error!!!

geoip{

source =\> {"clientip"  
}

}  
geoip{

source =\> {"clientip\_e"  
}

}

how can i do ???

---

<div class="post-metadata">

### Author: ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)
#### Post date: [August 7, 2018, 11:35am UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/2 "2018-08-07T11:35:06Z")

</div>

Hi @med_amine,

first, just FYI, it is much easier to read the config if you format it as _Preformated text_ 🙂

Do you get any error messages?

---

<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 7, 2018, 11:38am UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/3 "2018-08-07T11:38:23Z")

</div>

> source =\> {"clientip"  
> }

Remove the braces.

---

<div class="post-metadata">

### Author: ![med\_amine](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@med\_amine](https://discuss.elastic.co/u/med_amine)
#### Post date: [August 7, 2018, 11:56am UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/4 "2018-08-07T11:56:53Z")

</div>

But i have two fields which are the sources ,so what is the syntax to set two sources : clentip and clientip\_e

---

<div class="post-metadata">

### Author: ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)
#### Post date: [August 7, 2018, 12:05pm UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/5 "2018-08-07T12:05:20Z")

</div>

Try

```
geoip {
  source => "clientip"
}
geoip {
  source => "clientip_e"
}

```

Looks like you can only have one source per `geoip` filter [https://www.elastic.co/guide/en/logstash/6.3/plugins-filters-geoip.html#plugins-filters-geoip-source](https://www.elastic.co/guide/en/logstash/6.3/plugins-filters-geoip.html#plugins-filters-geoip-source)

If that does not work you can probably use a couple of `if`s

---

<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 7, 2018, 12:11pm UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/6 "2018-08-07T12:11:17Z")

</div>

But what is Logstash supposed to do with these fields? Will only one of them be populated at a time (and the parsed result should be stored in one field) or do you want it to always process both source fields and store the results in different fields?

---

<div class="post-metadata">

### Author: ![med\_amine](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@med\_amine](https://discuss.elastic.co/u/med_amine)
#### Post date: [August 7, 2018, 12:49pm UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/7 "2018-08-07T12:49:30Z")

</div>

thks it turns right now !

---

<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 4, 2018, 12:49pm UTC](https://discuss.elastic.co/t/how-can-i-set-two-geoip-source-fields/143309/8 "2018-09-04T12:49:34Z")

</div>

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