# Filebeat Module Custom Index

**URL:** <https://discuss.elastic.co/t/filebeat-module-custom-index/181350>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 16, 2019, 9:35am UTC](https://discuss.elastic.co/t/filebeat-module-custom-index/181350 "2019-05-16T09:35:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbws](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jbws](https://discuss.elastic.co/u/jbws)\
**Post date:** [May 16, 2019, 9:35am UTC](https://discuss.elastic.co/t/filebeat-module-custom-index/181350/1 "2019-05-16T09:35:22Z")

</div>

I currently have application logs going in to an index through Filebeat, but would like to use the NGINX module to send access and error logs to a seperate instance through the same Filebeat.

I can see how to set the log type for custom logs but cannot work out how to do this for a module.

(Filebeat 7 straight to Elasticsearch)

Thanks

---

<div class="post-metadata">

**Author:** ![ZhangYa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zhangya/32/46729_2.png) [@ZhangYa](https://discuss.elastic.co/u/ZhangYa)\
**Post date:** [May 17, 2019, 10:26pm UTC](https://discuss.elastic.co/t/filebeat-module-custom-index/181350/2 "2019-05-17T22:26:14Z")

</div>

```
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: true
setup.kibana:
  host: "192.168.47.175:5601"
output.elasticsearch:
  hosts: ["localhost:9200"]
  indices:
    - index: "nginx_access-%{[beat.version]}-%{+yyyy.MM.dd}"
      when.contains:
        fileset.name: "access"
    - index: "nginx_error-%{[beat.version]}-%{+yyyy.MM.dd}"
      when.contains:
        fileset.name: "error"
setup.template.name: "nginx"
setup.template.pattern: "nginx_*"
setup.template.enabled: false
setup.template.overwrite: true
```

---

<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:** [June 14, 2019, 10:28pm UTC](https://discuss.elastic.co/t/filebeat-module-custom-index/181350/3 "2019-06-14T22:28:32Z")

</div>

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