# Config not working for logstash 2

**URL:** <https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520>\
**Category:** Logstash\
**Created:** [November 2, 2015, 2:09pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520 "2015-11-02T14:09:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![imad](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@imad](https://discuss.elastic.co/u/imad)\
**Post date:** [November 2, 2015, 2:09pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/1 "2015-11-02T14:09:26Z")

</div>

Hi,

Can someone show me whats wrong with the config here. I am trying to convert my logstast 1.5.4 config to logstash 2. When I run it with --configtest flag, I get message 'Configuration is Ok'. and when I run the logstash agent with this config, index is not created. Any help will be greatly appreciated.

input {  
couchdb\_changes {  
db =\> "roles"  
hosts =\> ["127.0.0.1:5984"]  
sequence\_path =\> "seq\_files\roles\_couchdb\_seq"  
tags =\> ["roles"]  
}  
}  
output {  
if "roles" in [tags] {  
elasticsearch {  
document\_id =\> "%{[@metadata][\_id]}"  
hosts =\> ["127.0.0.1:9200"]  
index =\> "roles\_index"  
}  
}  
}

Thanks,  
Imad.

---

<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:** [November 2, 2015, 2:30pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/2 "2015-11-02T14:30:23Z")

</div>

Is there anything in the Logstash logs? What if you turn up the logging verbosity? What if you replace the elasticsearch output with a stdout output?

---

<div class="post-metadata">

**Author:** ![imad](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@imad](https://discuss.elastic.co/u/imad)\
**Post date:** [November 2, 2015, 2:35pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/3 "2015-11-02T14:35:39Z")

</div>

Here is the log file: [https://gist.github.com/imadulhaque/f2cc28f7b0f6c46d2c78#file-1122015logstash\_log-txt](https://gist.github.com/imadulhaque/f2cc28f7b0f6c46d2c78#file-1122015logstash_log-txt).

PS: I have updated log file on github.

---

<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:** [November 2, 2015, 2:46pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/4 "2015-11-02T14:46:09Z")

</div>

Partial quote of log:

> {:timestamp=\>"2015-11-02T09:38:52.904000-0500", :message=\>"A plugin had an unrecoverable error. Will restart this plugin.\n Plugin: \<LogStash::Inputs::CouchDBChanges db=\>"roles", host=\>"127.0.0.1:5984", sequence\_path=\>"seq\_files\\roles\_couchdb\_seq", tags=\>["roles"], codec=\>\<LogStash::Codecs::Plain charset=\>"UTF-8"\>, port=\>5984, secure=\>false, password=\>, heartbeat=\>1000, keep\_revision=\>false, ignore\_attachments=\>true, always\_reconnect=\>true, reconnect\_delay=\>10\>\n Error: bad component(expected host component): 127.0.0.1:5984\n Exception: URI::InvalidComponentError\n

Did the acceptable values for the `host` parameter change between 1.5.x and 2.0? The documentation doesn't mention support for specifying the port number.

---

<div class="post-metadata">

**Author:** ![imad](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@imad](https://discuss.elastic.co/u/imad)\
**Post date:** [November 2, 2015, 2:57pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/5 "2015-11-02T14:57:08Z")

</div>

Please see the updated log on github. I am still getting the error with hosts =\> ["127.0.0.1:5984"].

---

<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:** [November 2, 2015, 3:02pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/6 "2015-11-02T15:02:53Z")

</div>

AFAICT the parameter is named `host` and not `hosts` in Logstash 2.0. What if you use `host` and drop the port number?

---

<div class="post-metadata">

**Author:** ![imad](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@imad](https://discuss.elastic.co/u/imad)\
**Post date:** [November 2, 2015, 3:13pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/7 "2015-11-02T15:13:03Z")

</div>

Do you mean my config should be like this:  
input {  
couchdb\_changes {  
db =\> "roles"  
host =\> "127.0.0.1"  
sequence\_path =\> "seq\_files\roles\_couchdb\_seq"  
tags =\> ["roles"]  
}  
}  
output {  
if "roles" in [tags] {  
elasticsearch {  
document\_id =\> "%{[@metadata][\_id]}"  
hosts =\> ["127.0.0.1:9200"]  
index =\> "roles\_index"  
}  
}  
}  
how would it get data from couchdb if port number is dropped?

---

<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:** [November 2, 2015, 3:24pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/8 "2015-11-02T15:24:40Z")

</div>

> Do you mean my config should be like this:

Yes.

> how would it get data from couchdb if port number is dropped?

There's a `port` option that defaults to 5984.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [November 2, 2015, 3:25pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/9 "2015-11-02T15:25:47Z")

</div>

See [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-couchdb\_changes.html#plugins-inputs-couchdb\_changes-port](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-couchdb_changes.html#plugins-inputs-couchdb_changes-port)

---

<div class="post-metadata">

**Author:** ![imad](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@imad](https://discuss.elastic.co/u/imad)\
**Post date:** [November 2, 2015, 3:38pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/10 "2015-11-02T15:38:34Z")

</div>

Ok that worked, many thanks for this.

I am seeing deleted documents as well in my indices. Would these be coming from couchdb Do I need to filter those in logstash config file. How can I do that?

---

<div class="post-metadata">

**Author:** ![imad](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@imad](https://discuss.elastic.co/u/imad)\
**Post date:** [November 2, 2015, 4:52pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/11 "2015-11-02T16:52:54Z")

</div>

"I am seeing deleted documents as well in my indices. Would these be coming from couchdb Do I need to filter those in logstash config file. How can I do that?"  
will really appreciate any help, thanks.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [November 2, 2015, 6:05pm UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/12 "2015-11-02T18:05:07Z")

</div>

There is/was an issue where the document source is being sent with a delete command (this should not be so). This causes deletes to not work correctly.

Please check to see the status of this at [https://github.com/logstash-plugins/logstash-output-elasticsearch](https://github.com/logstash-plugins/logstash-output-elasticsearch)

(I'm at an airport and don't have good wifi, or I'd do the digging myself).

---

<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:24am UTC](https://discuss.elastic.co/t/config-not-working-for-logstash-2/33520/13 "2017-07-06T05:24:29Z")

</div>


