# Problem with multiple mapping types in 6.0. Not sure why

**URL:** <https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231>\
**Category:** Logstash\
**Created:** [November 18, 2017, 8:17am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231 "2017-11-18T08:17:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbsj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbsj/32/24378_2.png) [@mbsj](https://discuss.elastic.co/u/mbsj)\
**Post date:** [November 18, 2017, 8:17am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/1 "2017-11-18T08:17:50Z")

</div>

I have previously commented on another topic with a similar issue, but as that was beats related, and fixed by updates there, and mine is not, i a, creating this topic.

I am getting errors due to multiple mapping types, as per the 6.0 breaking changes, but i don't know why i have multiple mapping types.  
The data is delivered by a powershell script which gathers performance counter data and sends it to logstash. My logstash configuration looks like this:

```
input {
tcp {
	port => 5560 
	codec => "json"
	type => ["performancecounter"]
  }
}

filter {
	if [type] == "performancecounter" {
		grok {
			match => { "CounterPath" => [ "\\\\%{DATA:hostname}\\%{DATA:countergroup}\(%{DATA:hostname}\\private\$\\%{DATA:service}\)\\%{GREEDYDATA:Counter}", 
										  "\\\\%{DATA:hostname}\\%{DATA:countergroup}\\%{GREEDYDATA:Counter}" ] }
	}

	date { 
		"match" => ["MeasureTime", "yyyy-MM-dd HH:mm:ss,SSS"]
		target => "@timestamp"
	}
  }
}

output {
	if [type] == "performancecounter" {
		elasticsearch { 
			hosts => ["172.22.22.195:9200"] 
			index => "performance-%{+YYYY.MM.dd}"
		}
	} 
}

```

With this i get the following error:

```
[2017-11-17T10:50:46,492][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"performance-2017.11.17", :_type=>"performancecounter", :_routing=>nil}, #<LogStash::Event:0x126f6108>], :response=>{"index"=>{"_index"=>"performance-2017.11.17", "_type"=>"performancecounter", "_id"=>"9KhjyV8BDxseqbvrQakY", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [performance-2017.11.17] as the final mapping would have more than 1 type: [performancecounter, json]"}}}}

```

I have tried to work around it by removing the type and using add\_field to create a custom field, then check for that instead. But then i end up with this error:

```
[2017-11-17T10:58:27,378][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"performance-2017.11.17", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x345fcc96>], :response=>{"index"=>{"_index"=>"performance-2017.11.17", "_type"=>"doc", "_id"=>"dqhqyV8BDxseqbvrRboa", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [performance-2017.11.17] as the final mapping would have more than 1 type: [json, doc]"}}}}

```

I have other powershell scripts gathering performance counter data and delivering them to very similar configurations and i don't get an error. Where is that JSON type comming from? Is there a way to strip this in the filter or output, removing one value or forcing a specific value? I have tried using mutate in the filter to replace the type field with a new (the same) value but it doesn't change anything.

---

<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 18, 2017, 8:30am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/2 "2017-11-18T08:30:55Z")

</div>

Do you get any data indexed at all? Do you have any old index templates around that need to be updated?

---

<div class="post-metadata">

**Author:** ![mbsj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbsj/32/24378_2.png) [@mbsj](https://discuss.elastic.co/u/mbsj)\
**Post date:** [November 18, 2017, 9:27am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/3 "2017-11-18T09:27:15Z")

</div>

Thank you @Christian_Dahlqvist, I hadn't thought about the templates. I had created two, for the offending indexes, to solve another issue a while back and forgot all about them. This is all a learning experience.

Everything is running again after the upgrade to 6.0 😃

---

<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 18, 2017, 9:35am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/4 "2017-11-18T09:35:00Z")

</div>

Did you run the [Upgrade Assistant](https://www.elastic.co/guide/en/kibana/6.0/xpack-upgrade-assistant.html) prior to upgrading?

---

<div class="post-metadata">

**Author:** ![mbsj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbsj/32/24378_2.png) [@mbsj](https://discuss.elastic.co/u/mbsj)\
**Post date:** [November 18, 2017, 9:57am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/5 "2017-11-18T09:57:29Z")

</div>

No I dont use X-Pack. As i understand it, it's not free.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 18, 2017, 9:59am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/6 "2017-11-18T09:59:37Z")

</div>

If you register for a Basic license, which is free, you get access to the Upgrade Assistant.  
We'd highly recommend it.

---

<div class="post-metadata">

**Author:** ![mbsj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbsj/32/24378_2.png) [@mbsj](https://discuss.elastic.co/u/mbsj)\
**Post date:** [November 18, 2017, 10:05am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/7 "2017-11-18T10:05:00Z")

</div>

Oh it wasn't aware. I will do that right away.

---

<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 16, 2017, 10:05am UTC](https://discuss.elastic.co/t/problem-with-multiple-mapping-types-in-6-0-not-sure-why/108231/8 "2017-12-16T10:05:04Z")

</div>

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