# Filebeat multiple path and configs

**URL:** https://discuss.elastic.co/t/filebeat-multiple-path-and-configs/219230
**Category:** Beats
**Tags:** filebeat
**Created:** [February 13, 2020, 2:41pm UTC](https://discuss.elastic.co/t/filebeat-multiple-path-and-configs/219230 "2020-02-13T14:41:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![toms130](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toms130/32/58507_2.png) [@toms130](https://discuss.elastic.co/u/toms130)
#### Post date: [February 13, 2020, 2:41pm UTC](https://discuss.elastic.co/t/filebeat-multiple-path-and-configs/219230/1 "2020-02-13T14:41:55Z")

</div>

Hi,

I use filebeat for catching logs from kubernetes.

Actual config is

```
   - type: container
  paths:
    - /var/log/containers/*.log

```

I want to use a multiline config for some of my logs (/var/log/containers/celery-\*.log), and another multiline config for all other logs (/var/log/containers/ -everything except celery- \* logs).  
I'd like to keep the wildcard definition instead of listing all logs file so it stays dynamic.

How can I achieve this ?  
regards  
thomas

---

<div class="post-metadata">

### Author: ![faec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/faec/32/46988_2.png) [@faec](https://discuss.elastic.co/u/faec)
#### Post date: [February 14, 2020, 6:25pm UTC](https://discuss.elastic.co/t/filebeat-multiple-path-and-configs/219230/2 "2020-02-14T18:25:20Z")

</div>

The easiest approach is probably using the `include_files` / `exclude_files` options. You would specify two container inputs with the same path as you currently have, then in one of them add `include_files: ['celery-*.log']` (which will cause it to ignore all files that don't match that pattern) and in the other `exclude_files: ['celery-*.log']`. Then you can customize the input settings for each case as you like.

---

<div class="post-metadata">

### Author: ![toms130](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/toms130/32/58507_2.png) [@toms130](https://discuss.elastic.co/u/toms130)
#### Post date: [February 24, 2020, 1:29pm UTC](https://discuss.elastic.co/t/filebeat-multiple-path-and-configs/219230/3 "2020-02-24T13:29:14Z")

</div>

hi, thanks for answering me.

include\_files option does not exists , but idea was good with exclude\_files.

I used this syntax to separate config :

> ```
> filebeat.inputs:
> - type: container
> exclude_files: ['celery']
> paths:
> - /var/log/containers/*.log
> processors:
> - add_kubernetes_metadata:
> host: ${NODE_NAME}
> matchers:
> - logs_path:
> logs_path: "/var/log/containers/"
> - type: container
> paths:
> - /var/log/containers/celery-*.log
> processors:
> - add_kubernetes_metadata:
> host: ${NODE_NAME}
> matchers:
> - logs_path:
> logs_path: "/var/log/containers/"
> 
> ```

---

<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 23, 2020, 1:29pm UTC](https://discuss.elastic.co/t/filebeat-multiple-path-and-configs/219230/4 "2020-03-23T13:29:16Z")

</div>

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