# Logtash issue while inserting data

**URL:** https://discuss.elastic.co/t/logtash-issue-while-inserting-data/133742
**Category:** Logstash
**Created:** [May 29, 2018, 6:59pm UTC](https://discuss.elastic.co/t/logtash-issue-while-inserting-data/133742 "2018-05-29T18:59:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![saineshwar\_bageri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saineshwar_bageri/32/32688_2.png) [@saineshwar\_bageri](https://discuss.elastic.co/u/saineshwar_bageri)
#### Post date: [May 29, 2018, 6:59pm UTC](https://discuss.elastic.co/t/logtash-issue-while-inserting-data/133742/1 "2018-05-29T18:59:57Z")

</div>

Elasticsearch new version " **elasticsearch-6.2.4**" and logstash version " **logstash-6.2.4**".

I am pushing data from SQL server to Elasticsearch using logstash.

**Getting Error.**

[2018-05-29T23:55:19,493][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index",  
{:\_id=\>nil,  
:\_index=\>"humanresources", :\_type=\>"doc", :\_routing=\>nil}, #LogStash::Event:0x22a9c104], :response=\>{"index"=\>{"\_index"=\>"humanresources", "\_type"=

> "doc", "\_id"=\>"uV0lrWMBmPP2pmTTqIpx", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Rejecting mapping update to [humanres  
> ources] as the final mapping would have more than 1 type: [doc, employee]"}}}}

**config file**

input {  
jdbc {  
jdbc\_driver\_library =\> "D:\sqljdbc\_6.4.0.0\_enu\sqljdbc\_6.4\enu\mssql-jdbc-6.4.0.jre8.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://SAI;user=sa;password=#####;"  
jdbc\_user =\> "sa"  
jdbc\_password =\> "#####"  
statement =\> "SELECT \* FROM [AdventureWorks2008R2].[HumanResources].[Employee]"  
}  
}  
filter {  
}  
output {  
stdout { codec =\> json\_lines }  
elasticsearch {  
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "humanresources"  
}  
}

I have already create index with name " **humanresources**" and i have type " **employee**".

 ![2018-05-30%2000_25_35-Discuss%20the%20Elastic%20Stack](https://us1.discourse-cdn.com/elastic/original/3X/4/9/4918ba80f32783a20c71f22986852274e7438a0b.png)

---

<div class="post-metadata">

### Author: ![saineshwar\_bageri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saineshwar_bageri/32/32688_2.png) [@saineshwar\_bageri](https://discuss.elastic.co/u/saineshwar_bageri)
#### Post date: [May 30, 2018, 4:16am UTC](https://discuss.elastic.co/t/logtash-issue-while-inserting-data/133742/2 "2018-05-30T04:16:41Z")

</div>

The issue has been resolved.

The issue was that I have already created **index** and then

> I was trying to push data from Logstash into the same index

which it was creating an issue.

I have delete index which I had created now logstash inserting data works fine.

---

<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 27, 2018, 4:16am UTC](https://discuss.elastic.co/t/logtash-issue-while-inserting-data/133742/3 "2018-06-27T04:16:42Z")

</div>

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