# Question about mapping types in 6.X (and next versions)

**URL:** <https://discuss.elastic.co/t/question-about-mapping-types-in-6-x-and-next-versions/120478>\
**Category:** Logstash\
**Created:** [February 19, 2018, 3:27pm UTC](https://discuss.elastic.co/t/question-about-mapping-types-in-6-x-and-next-versions/120478 "2018-02-19T15:27:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 19, 2018, 3:27pm UTC](https://discuss.elastic.co/t/question-about-mapping-types-in-6-x-and-next-versions/120478/1 "2018-02-19T15:27:54Z")

</div>

Hello,

I recently updated from 5.6.2 to 6.2.1 and one the problems I had was related to the mapping types.

I was using filebeat to send data and setting the 'type' field in filebeat.yml, in Logstash I use the type value in filters and output, when I updated Logstash and Elasticsearch to 6.2.1, the type field from filebeat was ignored and the pipeline was broken, changing the name of the field from 'type' to a custom field named 'doctype' in filebeat.yml and in the logstash configuration solved the problem.

Since I heavily depend on the type value to use filters and outputs on my logstash configurations, my question is: will I be able to set the type field on other inputs like tcp or udp on the future versions?

Right now, besides filebeat, in which I cannot set the type field anymore, I have a 5.4 logstash instance with tcp and udp inputs where I set the type field like below:

```auto
tcp {
        host => "ip-address"
        port => 2514
        type => "custom-type"
}

udp {
        host => "ip-address"
        port => 2514
        type => "custom-type"
}

```

Reading the documentation it shows that for version 6.2 you still can set the type field for those inputs, but it will be supported in future versions?

Should I start to migrate from using the type field for using tags?

---

<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:** [February 21, 2018, 8:41pm UTC](https://discuss.elastic.co/t/question-about-mapping-types-in-6-x-and-next-versions/120478/2 "2018-02-21T20:41:00Z")

</div>

You'll always be able to have a field named `type`. It's how that string is used that's about to change. Maybe `type => "foo"` will stop working at some point but then you can just transform that into `add_field => { "type" => "foo" }`.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 21, 2018, 9:02pm UTC](https://discuss.elastic.co/t/question-about-mapping-types-in-6-x-and-next-versions/120478/3 "2018-02-21T21:02:58Z")

</div>

Thanks @magnusbaeck,

I'm going to review my logstash pipelines and start using add\_field in the inputs and add a custom field to use in the filters and in the outputs.

I think something like this will solve my problems now and avoid future problems.

```auto
input {
    tcp {
        add_field => { "doctype" => "custom-type" }
    }
}

filter {
    if [doctype] == "custom-type" { }
}

```

---

<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:** [March 21, 2018, 9:03pm UTC](https://discuss.elastic.co/t/question-about-mapping-types-in-6-x-and-next-versions/120478/4 "2018-03-21T21:03:37Z")

</div>

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