# Filter in input section

**URL:** <https://discuss.elastic.co/t/filter-in-input-section/101020>\
**Category:** Logstash\
**Created:** [September 19, 2017, 12:25pm UTC](https://discuss.elastic.co/t/filter-in-input-section/101020 "2017-09-19T12:25:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitin\_gupta](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@Nitin\_gupta](https://discuss.elastic.co/u/Nitin_gupta)\
**Post date:** [September 19, 2017, 12:25pm UTC](https://discuss.elastic.co/t/filter-in-input-section/101020/1 "2017-09-19T12:25:11Z")

</div>

Hi ,

i added fields in filebeat configuration to identify different types of files

My filebeat configuration

> - input\_type: log  
> paths:
> - c:\Users\user1\Desktop\ELK\server\_sftp.log.D\*  
> fields:  
> type\_log: sftp\_server
> 
> - input\_type: log  
> paths:
> - c:\Users\user1\Desktop\ELK\server\_ftp.log.D\*  
> fields:  
> type\_log: ftp\_server
> 
> - input\_type: log  
> paths:
> - c:\Users\user1\Desktop\ELK\client.log.D\*  
> fields:  
> type\_log: client

because Server and client logs are different in format  
server logs start with timestamp _in brackets_ eg:- [2017-09-19 00:00:27.741]  
whereas client logs start with timestamp _without brackets_ eg:- 2017-09-19 00:00:27.741

My issue is , i am including codec code for multiline in logstash input {} .  
is it possible to identify different types of logs and use multiline .

what i am expecting in logstash configuration is below .

- type\_log is the **field** included from filebeat configuration(above)

> input{  
> beats{  
> port=\>5044  
> if[type\_log] =~ "client" {  
> start\_position =\> "beginning"  
> codec =\> multiline {  
> pattern =\> "^%{TIMESTAMP\_ISO8601}"  
> negate =\> true  
> what =\> previous  
> }   
> }else if[type\_log] =~ "server"{  
> codec =\> multiline {  
> pattern =\> "^[%{TIMESTAMP\_ISO8601}]"  
> negate =\> true  
> what =\> previous  
> }  
> }  
> }  
> }

Please guide.

Regards  
Nitin

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 19, 2017, 7:36pm UTC](https://discuss.elastic.co/t/filter-in-input-section/101020/2 "2017-09-19T19:36:52Z")

</div>

Don't use multiline with the beats input on the Logstash side. You always want to do multiline processing as close to the source as possible.

---

<div class="post-metadata">

**Author:** ![Nitin\_gupta](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@Nitin\_gupta](https://discuss.elastic.co/u/Nitin_gupta)\
**Post date:** [September 20, 2017, 10:24am UTC](https://discuss.elastic.co/t/filter-in-input-section/101020/3 "2017-09-20T10:24:13Z")

</div>

Thanks @magnusbaeck

i will enable multiline in filebeat .

Is it possible to enable multiline for different input prospectors ?

for example  
different multiline pattern for

> input\_type: log  
> paths:  
> c:\Users\user1\Desktop\ELK\server\_ftp.log.D\*  
> fields:  
> type\_log: ftp\_server

and different pattern for

> ```
> input_type: log
> paths:
> c:\Users\user1\Desktop\ELK\client.log.D*
> fields:
> type_log: client
> 
> ```

or i need to use 2 different filebeat ??

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 20, 2017, 11:25am UTC](https://discuss.elastic.co/t/filter-in-input-section/101020/4 "2017-09-20T11:25:34Z")

</div>

The multiline configuration is specific to each prospector.

---

<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:** [October 18, 2017, 11:25am UTC](https://discuss.elastic.co/t/filter-in-input-section/101020/5 "2017-10-18T11:25:47Z")

</div>

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