# Rejecting mapping update to db as thee final mapping would have more than 1 type

**URL:** <https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825>\
**Category:** Elasticsearch\
**Created:** [November 21, 2019, 7:42am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825 "2019-11-21T07:42:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vatsalnarry2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vatsalnarry2/32/46950_2.png) [@vatsalnarry2](https://discuss.elastic.co/u/vatsalnarry2)\
**Post date:** [November 21, 2019, 7:42am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825/1 "2019-11-21T07:42:15Z")

</div>

I have create logstash-mysql.conf with below configuration. When i am running logstash.bat -f logstatshmysql.cong  
I am to see only last table is indexed.

# Sample Logstash configuration for creating a simple

# Beats -\> Logstash -\> Elasticsearch pipeline.

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/db"  
jdbc\_user =\> "root"  
jdbc\_password =\> "password"

```
	jdbc_driver_class => "com.mysql.jdbc.Driver"
	statement => "SELECT * FROM meeting"
	type=>"dat_meeting"
}
jdbc {
	jdbc_connection_string => "jdbc:mysql://localhost:3306/db"
	jdbc_user => "root"
	jdbc_password => "password"
	
	jdbc_driver_class => "com.mysql.jdbc.Driver"
	statement => "SELECT * FROM meeting_invities;"
	
	type=>"dat_meeting_invities"
}

```

}  
output {  
stdout { codec =\> json\_lines }  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "meetingroomdb"

```
	 document_type => "%{type}" # <- use the type from each input
}

```

}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 21, 2019, 7:48am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825/2 "2019-11-21T07:48:26Z")

</div>

In recent versions of Elasticsearch indices can only have one type so you cannot have different types for the two inputs if they are going to the same index. You could instead set a field with the type and filter on this if needed.

---

<div class="post-metadata">

**Author:** ![vatsalnarry2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vatsalnarry2/32/46950_2.png) [@vatsalnarry2](https://discuss.elastic.co/u/vatsalnarry2)\
**Post date:** [November 21, 2019, 8:19am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825/3 "2019-11-21T08:19:06Z")

</div>

Thanks for reply. I am newbie to logstash and elastic search.  
Can you suggest sample code for multiple jdbc input plugin with filter

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 21, 2019, 8:20am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825/4 "2019-11-21T08:20:36Z")

</div>

Just remove the type parameter from the jdbc input or Shane this to add field with the type setting.

---

<div class="post-metadata">

**Author:** ![vatsalnarry2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vatsalnarry2/32/46950_2.png) [@vatsalnarry2](https://discuss.elastic.co/u/vatsalnarry2)\
**Post date:** [November 21, 2019, 9:26am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825/5 "2019-11-21T09:26:35Z")

</div>

I have removed type parameter and added tag for each jdbc input.  
I am checking in output for tags but still i am getting error and only last table is getting indexed.

Rejecting mapping update to [db] as thee final mapping would have more than 1 type: [meeting\_invities, meetingroom  
"}}}}

---

<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:** [December 19, 2019, 9:26am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-db-as-thee-final-mapping-would-have-more-than-1-type/208825/6 "2019-12-19T09:26:39Z")

</div>

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