# Help need to create filter

**URL:** <https://discuss.elastic.co/t/help-need-to-create-filter/80851>\
**Category:** Logstash\
**Created:** [March 31, 2017, 5:06pm UTC](https://discuss.elastic.co/t/help-need-to-create-filter/80851 "2017-03-31T17:06:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giri](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@Giri](https://discuss.elastic.co/u/Giri)\
**Post date:** [March 31, 2017, 5:06pm UTC](https://discuss.elastic.co/t/help-need-to-create-filter/80851/1 "2017-03-31T17:06:55Z")

</div>

HI,

I am newbie to Logstash, trying out few options.  
I need help in creating my filter to store the values in the line #5 of log file as Output required below

#CONFIG USED  
input {  
file {  
path =\> "D:/Log.txt"   
start\_position =\> "beginning"

}  
}  
grok {  
match =\> { "message" =\> "%{TIMESTAMP:timestamp} %{WORD:username} %{WORD:group} %{WORD:role}" ]  
}

output {  
elasticsearch { hosts =\> ["localhost:9200"] }   
}

#LOG FILE:

INFO - 2017/03/27-06:01:16.189 UTC - BNG1307005326D.09944 - CORBA server is starting - Teamcenter.SOA.tcserver\_itk\_main  
INFO - 2017/03/27-06:01:22.463 UTC - .UnknownClient.00001 - Service Request: Core-2011-06-Session:login - Teamcenter.Soa.Communication  
INFO - 2017/03/27-06:01:23.419 UTC - .UnknownClient.00001 - library libFnd0profiler is delay loaded - Teamcenter.Metamodel.MetaFrameWork at D:\workdir\tc1123w1205\_64\src\core\metaframework\BusinessObjectRegistryImpl.cxx(2466)  
INFO - 2017/03/27-06:01:24.174 UTC - .UnknownClient.00001 - Default encryption configuration. - Teamcenter.FoundationBase at D:\workdir\tc1123w1205\_64\src\foundation\base\Crypto.cxx(106)  
INFO - 2017/03/27-06:01:25.181 UTC - .UnknownClient.00001 - POM\_login: "UserA" GroupA / RoleA has logged in - Teamcenter.POM at D:\workdir\tc1123w1205\_64\src\foundation\pom\pom\pom\_start.cxx(1296)  
INFO - 2017/03/27-06:01:25.340 UTC - .UnknownClient.00001 - library libFnd0disclosure is delay loaded - Teamcenter.Metamodel.MetaFrameWork at D:\workdir\tc1123w1205\_64\src\core\metaframework\BusinessObjectRegistryImpl.cxx(2466)  
Successfully loaded dynamic module D:\Annex\aeapps\TC11\tcroot\bin\libFnd0disclosure.dll  
NOTE - 2017/03/27-06:01:25.341 UTC - .UnknownClient.00001 - TC\_AM\_user\_init: Invoking Customize\_Access\_Manager callback - [Teamcenter.Organization.sa](http://Teamcenter.Organization.sa) at D:\workdir\tc1123w1205\_64\src\core\sa\am\_fru.cxx(3679)

#Output required  
"@timestamp" =\> 2017/03/27-06:01:25.340, "@username" =\> "UserA",  
@group" =\> "GroupA",  
"@role" =\> "RoleA"

Regards  
Giri

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [March 31, 2017, 5:25pm UTC](https://discuss.elastic.co/t/help-need-to-create-filter/80851/2 "2017-03-31T17:25:54Z")

</div>

you can use `POM_login: "%{USER:user}" %{WORD:group} / %{WORD:role}`

for a more complete and flexible expression, you can use [https://grokdebug.herokuapp.com/](https://grokdebug.herokuapp.com/)

put your example line in the text box above, and gradually build the expression below, seeing what matches

---

<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:** [April 28, 2017, 5:25pm UTC](https://discuss.elastic.co/t/help-need-to-create-filter/80851/3 "2017-04-28T17:25:59Z")

</div>

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