# Filebeat condition

**URL:** <https://discuss.elastic.co/t/filebeat-condition/302225>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 12, 2022, 12:28pm UTC](https://discuss.elastic.co/t/filebeat-condition/302225 "2022-04-12T12:28:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex\_vermex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_vermex/32/101267_2.png) [@alex\_vermex](https://discuss.elastic.co/u/alex_vermex)\
**Post date:** [April 12, 2022, 12:28pm UTC](https://discuss.elastic.co/t/filebeat-condition/302225/1 "2022-04-12T12:28:35Z")

</div>

Hi,  
I use filebeat to read logs from different paths so for example  
filebeat.yml

```auto
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - D:\elastic_stack\LOGS\test-LOGS1\*
  fields:
        kafka_topic: "kafka-topic-test1"  
  multiline.type: pattern
  multiline.pattern: '^\d{4}-\d{2}:\d{2}:\d{2}:\d{3}'
  multiline.negate: true
  multiline.match: after
  multiline.max_lines: 19
  
- type: log
  enabled: true
  paths:
    - D:\elastic_stack\LOGS\test-LOG2\*
  fields:
        kafka_topic: "kafka-topic-test2"
  multiline.type: pattern
  multiline.pattern: '^\d{2}/\d{2}/\d{4}\s\d{2}:\d{2}:\d{2}\s\d{3}-\sSTART\sCONNECTION.'
  multiline.negate: true
  multiline.match: after
  multiline.max_lines: 120

```

I would like to know if there is somthing like condition in paths i mean for example if **D:\elastic\_stack\LOGS\test-LOGS1\LOG1.txt** contains **\d{4}-\d{2}:\d{2}:\d{2}:\d{3}|** keep it and do the multiline and ..... else make this LOG1.txt under another path for example move it to D:\elastic\_stack\LOG1.txt

Any help would be sincerely appreciate!  
Thanks.

---

<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 10, 2022, 2:29pm UTC](https://discuss.elastic.co/t/filebeat-condition/302225/2 "2022-05-10T14:29:12Z")

</div>

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