# Filebeat fields are not working

**URL:** https://discuss.elastic.co/t/filebeat-fields-are-not-working/122155
**Category:** Logstash
**Created:** [March 1, 2018, 9:11pm UTC](https://discuss.elastic.co/t/filebeat-fields-are-not-working/122155 "2018-03-01T21:11:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![red888](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@red888](https://discuss.elastic.co/u/red888)
#### Post date: [March 1, 2018, 9:11pm UTC](https://discuss.elastic.co/t/filebeat-fields-are-not-working/122155/1 "2018-03-01T21:11:02Z")

</div>

Here is my filebeat config:

```
filebeat.prospectors:
- type: log
  paths:
    - C:/inetpub/app01/logs/IIS/*/*.log
  fields:
    app_group: iis
    app_id: app01

- type: log
  paths:
    - C:/inetpub/app02/logs/IIS/*/*.log
  fields:
    app_group: iis
    app_id: app02

- type: log
  paths:
    - C:/inetpub/app03/logs/IIS/*/*.log
  fields:
    app_group: iis
    app_id: app03

output:
  logstash:
    hosts: ["myserver:7777"]

```

And here is logstash:

```
input {
  beats {
    port => 7777
  }
}

filter {
  if [fields][app_group] == "iis" {
    .... do my parsing ...
  }
}

output {
  if [fields][app_group] == "iis" {
    elasticsearch {
      hosts => "mycluster"
      index => "logstash-iis-%{[fields][app_id]}-%{+YYYY-MM-dd}"
    }
  } else {
    elasticsearch {
      hosts => "mycluster"
      index => "uncategorized"
    }
  }
}

```

They are all getting pushed into my "uncategorized" index which means the fields aren't getting applied or if [fields][app\_group] is wrong or something. I can't find any example with setting multiple fields and having logstash access them

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [March 1, 2018, 9:34pm UTC](https://discuss.elastic.co/t/filebeat-fields-are-not-working/122155/2 "2018-03-01T21:34:04Z")

</div>

Both configurations look OK to me. You don't have fields\_under\_root set in filebeat, right?

I suggest you look at the events in elasticsearch and make sure they really do have [fields][app\_group] set.

---

<div class="post-metadata">

### Author: ![red888](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@red888](https://discuss.elastic.co/u/red888)
#### Post date: [March 1, 2018, 9:34pm UTC](https://discuss.elastic.co/t/filebeat-fields-are-not-working/122155/3 "2018-03-01T21:34:59Z")

</div>

yeah i don't have fields\_under\_root set. Should i be able to see the "fields" for the events in kibana?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [March 1, 2018, 9:54pm UTC](https://discuss.elastic.co/t/filebeat-fields-are-not-working/122155/4 "2018-03-01T21:54:21Z")

</div>

Yes. Look at [this post](https://discuss.elastic.co/t/parse-sonarqube-logs/122130/3?u=badger) for an example.

---

<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 29, 2018, 9:54pm UTC](https://discuss.elastic.co/t/filebeat-fields-are-not-working/122155/5 "2018-03-29T21:54:48Z")

</div>

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