# LogStash could not index to Elactic search

**URL:** <https://discuss.elastic.co/t/logstash-could-not-index-to-elactic-search/180642>\
**Category:** Logstash\
**Created:** [May 11, 2019, 11:33am UTC](https://discuss.elastic.co/t/logstash-could-not-index-to-elactic-search/180642 "2019-05-11T11:33:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kailaash\_k](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kailaash_k/32/46026_2.png) [@Kailaash\_k](https://discuss.elastic.co/u/Kailaash_k)\
**Post date:** [May 11, 2019, 11:33am UTC](https://discuss.elastic.co/t/logstash-could-not-index-to-elactic-search/180642/1 "2019-05-11T11:33:25Z")

</div>

LogStash is able to get input from filebeat but its not able to log it in elasticsearch.

Lostash.conf :

##log stash get input from here with file beat  
input {  
beats {  
type =\> "test"  
port =\> "6000"  
}  
}

# output to elasticsearch on port 9200

output {

stdout {  
codec =\> rubydebug  
}

# Sending properly parsed log events to elasticsearch

elasticsearch {  
hosts =\> ["localhost:9200"]  
}  
}

#FileBeat sending output to port 6000  
output.logstash:  
#loadbalance: true  
hosts: ["localhost:6000"]

## I'm getting this error :=\> Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"logstash", :\_type=\>"\_doc", :routing=\>nil}, #LogStash::Event:0x23895e6c], :response=\>{"index"=\>{"\_index"=\>"logstash-2019.05.09-000001", "\_type"=\>"\_doc", "\_id"=\>"AtUPpmoBiN9TtUPVPKw2", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse field [host] of type [text] in document with id 'AtUPpmoBiN9TtUPVPKw2'", "caused\_by"=\>{"type"=\>"illegal\_state\_exception", "reason"=\>"Can't get text on a START\_OBJECT at 1:499"}}}}}

But I'm able to log to elasticsearch from both logstash and Filebeat seperately.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 11, 2019, 9:27pm UTC](https://discuss.elastic.co/t/logstash-could-not-index-to-elactic-search/180642/2 "2019-05-11T21:27:20Z")

</div>

I would expect there to be a more informative error logged in the elasticsearch log file.

---

<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:** [June 8, 2019, 9:27pm UTC](https://discuss.elastic.co/t/logstash-could-not-index-to-elactic-search/180642/3 "2019-06-08T21:27:23Z")

</div>

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