# Set \_type in logstash

**URL:** <https://discuss.elastic.co/t/set-type-in-logstash/260643>\
**Category:** Logstash\
**Created:** [January 10, 2021, 12:30pm UTC](https://discuss.elastic.co/t/set-type-in-logstash/260643 "2021-01-10T12:30:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![navin1093](https://avatars.discourse-cdn.com/v4/letter/n/e47c2d/32.png) [@navin1093](https://discuss.elastic.co/u/navin1093)\
**Post date:** [January 10, 2021, 12:30pm UTC](https://discuss.elastic.co/t/set-type-in-logstash/260643/1 "2021-01-10T12:30:43Z")

</div>

Hi experts.

As per my research

- index (Elastic Search) -\> database (RDMS)
- type (Elastic Search) -\> table (RDMS)

Can i know how i can set the type?

```auto
input {
  beats {
    port => 5044
    ...
    type => "%{[fields][name_of_log]}"
  }
}
  ...
output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "%{[fields][name_of_index]}"
  }
}

```

---

<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:** [January 10, 2021, 4:20pm UTC](https://discuss.elastic.co/t/set-type-in-logstash/260643/2 "2021-01-10T16:20:32Z")

</div>

Your research seems to be outdated, there is no types in elasticsearch anymore and you should not rely on types in index for anything.

Which version of the stack are you using?

I recommend that you read about the [removal of mapping types](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/removal-of-types.html).

---

<div class="post-metadata">

**Author:** ![navin1093](https://avatars.discourse-cdn.com/v4/letter/n/e47c2d/32.png) [@navin1093](https://discuss.elastic.co/u/navin1093)\
**Post date:** [January 11, 2021, 1:21am UTC](https://discuss.elastic.co/t/set-type-in-logstash/260643/3 "2021-01-11T01:21:57Z")

</div>

thanks i am using 7.\* version. So i can assume index will be the same join as database and table name

---

<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:** [February 8, 2021, 1:22am UTC](https://discuss.elastic.co/t/set-type-in-logstash/260643/4 "2021-02-08T01:22:05Z")

</div>

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