# Filebeat Multiple input filter and send to multiple indexes

**URL:** <https://discuss.elastic.co/t/filebeat-multiple-input-filter-and-send-to-multiple-indexes/232394>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 13, 2020, 8:44am UTC](https://discuss.elastic.co/t/filebeat-multiple-input-filter-and-send-to-multiple-indexes/232394 "2020-05-13T08:44:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gokul\_Kandasamy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul_kandasamy/32/68221_2.png) [@Gokul\_Kandasamy](https://discuss.elastic.co/u/Gokul_Kandasamy)\
**Post date:** [May 13, 2020, 8:44am UTC](https://discuss.elastic.co/t/filebeat-multiple-input-filter-and-send-to-multiple-indexes/232394/1 "2020-05-13T08:44:55Z")

</div>

Hi All,

I Have multiple types of all log in a file

{z: "a", "id: "x", "name": "Y", "source": "app-name"}

{log: "a", "id: "x", "name": "Y", "amt": 100}

I want to filter the logs and send them to different elastic search indexes.

And also in the same instance using the filebeat i want to send traefik logs.

Is this possible.

My right now not working filebeat config is below.

```
filebeat.inputs:
  - type: log
paths:
  - /var/log/app/log-1.log
json.keys_under_root: true
json.add_error_key: true
json.message_key: log
fields_under_root: true
encoding: plain
enabled: true
exclude_lines: ['.*feedback.*']
exclude_lines: ['.*traefik.*']
fields:
 server: gokul-1
tags: ["json"]
  - type: log
paths:
  - /var/log/traefik/access.log
fields:
 server: traefik
output.elasticsearch:
  hosts: ["https://elastic"]

  username: ""
  index: "gokul-test-%{+yyyy.MM.dd}"
  indices:
- index: filebeat-7.6.2-%{+yyyy.MM.dd}"
  when.equals:
   server: traefik

  password: ""
setup.template:
  name: "gokul-test"
  pattern: "gokul-test-*"
  path: /var/log/gokul/access.log
setup.ilm.enabled: false

filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml

```

Here all logs are being pushed to gokul-test index.

---

<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 10, 2020, 8:50am UTC](https://discuss.elastic.co/t/filebeat-multiple-input-filter-and-send-to-multiple-indexes/232394/2 "2020-06-10T08:50:46Z")

</div>

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