# Multiple paths logstash output

**URL:** <https://discuss.elastic.co/t/multiple-paths-logstash-output/296831>\
**Category:** Logstash\
**Created:** [February 10, 2022, 10:51am UTC](https://discuss.elastic.co/t/multiple-paths-logstash-output/296831 "2022-02-10T10:51:21Z")\
**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:** [February 10, 2022, 10:51am UTC](https://discuss.elastic.co/t/multiple-paths-logstash-output/296831/1 "2022-02-10T10:51:22Z")

</div>

Hi,  
filebeat config:

```auto
filebeat.inputs:
- type: log
enabled: true
paths:
    - D:\elastic_stack\testLog\*
    - D:\elastic_stack\LogWal\*

```

So in logstash i want for the first path did the split of the message and add fields like i did:

```auto
input {
    beats {
	    type => "test"
        port => "5044"
    }
}

filter {
    mutate {
      split => {"message" => "|"}
      add_field => { "date" => "%{[message][0]}" }
      add_field => { "version" => "%{[message][1]}" }
      }

```

for the second path i dont want to split message or adding field or somthing i just want this bloc in output:

```auto
output{
if ("Exception" in [message] or "EXCEPTION" in [message]) {
    email {
    to => "aa@gmail.com"
    via => 'smtp'
	address => 'smtp.gmail.com'
    domain => 'smtp.gmail.com'
	from => 'jo@gmail.com'
    authentication => "plain"
    username => "jo@gmail.com"
	password => "pass"
	subject => 'Alert '
	body => "%{message}"
	port => 25
	use_tls => true
    }
    }
}

```

Sending email it works if i remove the split and the split it works i just want to keep them and make the split work just for the first path and the sending email just for second path.

Thanks in advance.

---

<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 10, 2022, 10:52am UTC](https://discuss.elastic.co/t/multiple-paths-logstash-output/296831/2 "2022-03-10T10:52:03Z")

</div>

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