# Using filebeat modules with custom fields

**URL:** <https://discuss.elastic.co/t/using-filebeat-modules-with-custom-fields/228909>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 20, 2020, 5:41pm UTC](https://discuss.elastic.co/t/using-filebeat-modules-with-custom-fields/228909 "2020-04-20T17:41:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Burga](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@Burga](https://discuss.elastic.co/u/Burga)\
**Post date:** [April 20, 2020, 5:41pm UTC](https://discuss.elastic.co/t/using-filebeat-modules-with-custom-fields/228909/1 "2020-04-20T17:41:38Z")

</div>

Hi guys , I'm wondering , can I enable module and use fields in filebeat.yml file?

I just configured filebeat input

```auto

filebeat.inputs:

- type: log

  paths:

    - /var/log/messages

  document_type: syslog
  fields:
        log_type: "syslog"
  enable: true
  fields_under_root: true
  multiline.pattern: '^[0-9][0-9]:[0-9][0-9]:'
  multiline.negate: true
  multiline.match: after

` `` 

but I can't start filebeat with module enabled .

Best Regards.
```

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [April 20, 2020, 6:11pm UTC](https://discuss.elastic.co/t/using-filebeat-modules-with-custom-fields/228909/2 "2020-04-20T18:11:05Z")

</div>

> [@Burga](#):
>
> but I can't start filebeat with module enabled .

Could you post the errors you are getting when you try to start Filebeat?

---

<div class="post-metadata">

**Author:** ![Burga](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@Burga](https://discuss.elastic.co/u/Burga)\
**Post date:** [April 20, 2020, 6:13pm UTC](https://discuss.elastic.co/t/using-filebeat-modules-with-custom-fields/228909/3 "2020-04-20T18:13:15Z")

</div>

```auto
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com filebeat[45466]: Exiting: Can only start an input when all related states are finished: {Id:34379986-64768 Finished:false Fileinfo:0xc00057c270 Sourc...79986-64768}
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: filebeat.service: main process exited, code=exited, status=1/FAILURE
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: Unit filebeat.service entered failed state.
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: filebeat.service failed.
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: filebeat.service holdoff time over, scheduling restart.
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: Stopped Filebeat sends log files to Logstash or directly to Elasticsearch..
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: start request repeated too quickly for filebeat.service
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: Failed to start Filebeat sends log files to Logstash or directly to Elasticsearch..
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: Unit filebeat.service entered failed state.
Apr 20 21:12:08 ild-tlv-mongodb02.checkpoint.com systemd[1]: filebeat.service failed.

```

---

<div class="post-metadata">

**Author:** ![Burga](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@Burga](https://discuss.elastic.co/u/Burga)\
**Post date:** [April 20, 2020, 11:11pm UTC](https://discuss.elastic.co/t/using-filebeat-modules-with-custom-fields/228909/4 "2020-04-20T23:11:30Z")

</div>

I managed to "solve " the issue , just changed syslog.yml by adding "- /var/log/\*.log "

```auto
type: log
paths:
**#{{ range $i, $path := .paths }}**
 **# - {{$path}}**
 **#{{ end }}**
  - /var/log/*.log
exclude_files: [".gz$"]
multiline:
  pattern: "^\\s"
  match: after
processors:
- add_locale: ~

```

but somehow filebeat although the system module is enabled it running threw the filebeat.yml input and takes fields values

```auto

- type: log

  paths:

    - /var/log/messages

  document_type: syslog
  fields:
        log_type: "syslog"

```

why is that ? if system module is enabled shouldn't it use only modules input parameters ? how can I check if it uses system module ?

Best Regards.

---

<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:** [May 18, 2020, 11:11pm UTC](https://discuss.elastic.co/t/using-filebeat-modules-with-custom-fields/228909/5 "2020-05-18T23:11:34Z")

</div>

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