# Using "fields.type" in logstash 7.6

**URL:** https://discuss.elastic.co/t/using-fields-type-in-logstash-7-6/255105
**Category:** Elasticsearch
**Created:** [November 11, 2020, 5:31pm UTC](https://discuss.elastic.co/t/using-fields-type-in-logstash-7-6/255105 "2020-11-11T17:31:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Atul\_Chadha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_chadha/32/75469_2.png) [@Atul\_Chadha](https://discuss.elastic.co/u/Atul_Chadha)
#### Post date: [November 11, 2020, 5:31pm UTC](https://discuss.elastic.co/t/using-fields-type-in-logstash-7-6/255105/1 "2020-11-11T17:31:22Z")

</div>

Upgrading from 5.6 to 7.6, how can i use the "fields.type" in logstash to filter out data and also in output section. We had "type" field earlier configured however i believe its not longer supported now.

```
input {
  beats {
    port => 5044
  }
  beats {
    port => 5045
  }
}
filter {
  if [fields.type] == "inf_os_logs" {
  grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp}" }
    }
# }
}

output {
  if [type] == "inf_os_logs" {
    elasticsearch {
      hosts => ["XXXXX"]
      #index=> "%{type}"
      index=> "inf_%{[fields][type]}_logs"
      user => "XXXX"
      password => "XXXX"
     }
  }
}

```

I am able to get the logs fine with the "field.type" correct in elasticsearch however the logstash doesn't seem to like it for some reason and sort of drops it there.

---

<div class="post-metadata">

### Author: ![Atul\_Chadha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_chadha/32/75469_2.png) [@Atul\_Chadha](https://discuss.elastic.co/u/Atul_Chadha)
#### Post date: [November 17, 2020, 9:26am UTC](https://discuss.elastic.co/t/using-fields-type-in-logstash-7-6/255105/2 "2020-11-17T09:26:43Z")

</div>

Checking if anyone has any ideas ?

---

<div class="post-metadata">

### Author: ![Atul\_Chadha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_chadha/32/75469_2.png) [@Atul\_Chadha](https://discuss.elastic.co/u/Atul_Chadha)
#### Post date: [November 24, 2020, 2:31pm UTC](https://discuss.elastic.co/t/using-fields-type-in-logstash-7-6/255105/3 "2020-11-24T14:31:50Z")

</div>

For anyone who is struggling like me, i was able to use it this way

`if [fields][type] == "string"`

---

<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 22, 2020, 2:32pm UTC](https://discuss.elastic.co/t/using-fields-type-in-logstash-7-6/255105/4 "2020-12-22T14:32:07Z")

</div>

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