# Send multiple log files to elastic via filebeat

**URL:** https://discuss.elastic.co/t/send-multiple-log-files-to-elastic-via-filebeat/83202
**Category:** Beats
**Created:** [April 21, 2017, 12:20pm UTC](https://discuss.elastic.co/t/send-multiple-log-files-to-elastic-via-filebeat/83202 "2017-04-21T12:20:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sLuvpreet33](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sluvpreet33/32/50626_2.png) [@sLuvpreet33](https://discuss.elastic.co/u/sLuvpreet33)
#### Post date: [April 21, 2017, 12:20pm UTC](https://discuss.elastic.co/t/send-multiple-log-files-to-elastic-via-filebeat/83202/1 "2017-04-21T12:20:01Z")

</div>

I want to send multiple log files from filebeat to elastic.

Like this,

```
filebeat.prospectors:

  - input_type: log
     paths:
       - /var/log/postgresql/postgresql-2017-04-21_120121.log
     document_type: postgresql
  - input_type: log
     paths:
       - /var/log/nginx/alpha-acccess.log
     document_type: nginx

```

In the output, I want to send to elasticseach,

```
output.elasticsearch:
  # Array of hosts to connect to.
   hosts: ["localhost:9200"]
   index: 'postgresql-log'
   versions.2x.enabled: false

```

I want to store the "postgresql" logs under the `postgresql` index, and the nginx log under the `nginx` index.

But here in the filebeat.yml , I can give only 1 name to the index, means these both will be stored under 1 index. How can I store these under different indices ?

I do not want to use logstash as that is too heavy and my system has trouble running logstash.

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [April 24, 2017, 8:31am UTC](https://discuss.elastic.co/t/send-multiple-log-files-to-elastic-via-filebeat/83202/2 "2017-04-24T08:31:01Z")

</div>

The index name supports format strings. This should be helpful in your case: [https://www.elastic.co/guide/en/beats/libbeat/current/config-file-format-type.html#\_format\_string\_sprintf](https://www.elastic.co/guide/en/beats/libbeat/current/config-file-format-type.html#_format_string_sprintf)

---

<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 12, 2017, 12:35pm UTC](https://discuss.elastic.co/t/send-multiple-log-files-to-elastic-via-filebeat/83202/3 "2017-05-12T12:35:32Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
