# Logstash grok filter for removing comments

**URL:** <https://discuss.elastic.co/t/logstash-grok-filter-for-removing-comments/47099>\
**Category:** Logstash\
**Created:** [April 12, 2016, 9:34am UTC](https://discuss.elastic.co/t/logstash-grok-filter-for-removing-comments/47099 "2016-04-12T09:34:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameeelastic](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rameeelastic](https://discuss.elastic.co/u/rameeelastic)\
**Post date:** [April 12, 2016, 9:34am UTC](https://discuss.elastic.co/t/logstash-grok-filter-for-removing-comments/47099/1 "2016-04-12T09:34:38Z")

</div>

I have a websphere ESB log that I am trying to parse and the log file contains certain entries that are comments that needs to be removed. I am actually using dateparsefailure and grokparsefailure conditions to drop these comments but I want to put a filter , below are the comment lines.

\*\*\*\*\*\*\*\*\*\*\*\* Start Display Current Environment \*\*\*\*\*\*\*\*\*\*\*\*  
WebSphere Platform 8.0.0.7 [ND 8.0.0.7 cf071329.03][BPMPC 8.0.1.2 20131028-091607] running with process name  
Host Operating System is Linux, version 2.6.32-279.22.1.el6.x86\_64  
Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM  
was.install.root = /apps/esbprod/IBM/ESB/V8  
user.install.root = /apps/esbprod/IBM/ESB/V8/profiles/ae7hf135Node01ESBP  
Java Home = /apps/esbprod/IBM/ESB/V8/java/jre  
ws.ext.dirs = /apps/esbprod/IBM/ESB/V8/java/lib:/apps/esbprod/  
Classpath = /apps/esbprod/IBM/ESB/V8/profiles/ae7hf135Node01ESBP/  
Java Library path = /apps/esbprod/IBM/ESB/V8/lib/native/linux/x86\_64/  
Orb Version = IBM Java ORB build orb626ifx-20130530.00 (IX90121)  
\*\*\*\*\*\*\*\*\*\*\*\*\* End Display Current Environment \*\*\*\*\*\*\*\*\*\*\*\*\*

How would I write a drop filter for the above.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 13, 2016, 2:05am UTC](https://discuss.elastic.co/t/logstash-grok-filter-for-removing-comments/47099/2 "2016-04-13T02:05:33Z")

</div>

Do you have that block defined as a field in your multiline config?

---

<div class="post-metadata">

**Author:** ![rameeelastic](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rameeelastic](https://discuss.elastic.co/u/rameeelastic)\
**Post date:** [April 14, 2016, 7:34am UTC](https://discuss.elastic.co/t/logstash-grok-filter-for-removing-comments/47099/3 "2016-04-14T07:34:23Z")

</div>

No , I don't. Below is my logstash config file.

input {  
file {  
path =\> "D:/Test/\*.log"  
start\_position =\> "beginning" #  
codec =\> multiline {  
pattern =\> "^%{SYSLOG5424SD}"  
negate =\> true  
what =\> previous  
}  
}  
}

filter {

```
grok {
	match => ["message", "%{SYSLOG5424SD:EventDateTime} %{WORD:ErrorNumber} %{WORD:Module} (?<ErrorDetails>[^*]{0,1500})"]
}

date {
  match => ["EventDateTime", "'['MM/dd/yy HH:mm:ss:SSS 'CEST]'"]
  target => "@timestamp"
}

if "_grokparsefailure" in [tags] {
  drop { }
}

if "_dateparsefailure" in [tags] {
  drop { }
}

```

}

output {  
stdout { codec =\> rubydebug }  
elasticsearch {  
hosts =\> ["127.0.0.1:9200"]  
index =\> "websphere-%{+YYYY.MM.dd}"  
}  
}

---

<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:** [July 6, 2017, 5:02am UTC](https://discuss.elastic.co/t/logstash-grok-filter-for-removing-comments/47099/4 "2017-07-06T05:02:20Z")

</div>


