# Grep in logstash

**URL:** <https://discuss.elastic.co/t/grep-in-logstash/24510>\
**Category:** Logstash\
**Created:** [June 28, 2015, 5:42pm UTC](https://discuss.elastic.co/t/grep-in-logstash/24510 "2015-06-28T17:42:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_PS](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@Lee\_PS](https://discuss.elastic.co/u/Lee_PS)\
**Post date:** [June 28, 2015, 5:42pm UTC](https://discuss.elastic.co/t/grep-in-logstash/24510/1 "2015-06-28T17:42:09Z")

</div>

Hi

I am using grep in conf . while i am doing the test am getting the following error  
[lee@server1 logstash-1.5.0]$ bin/logstash -f test4.conf --configtest  
The error reported is:  
Couldn't find any filter plugin named 'grep'. Are you sure this is correct? Trying to load the grep filter plugin resulted in this error: no such file to load -- logstash/filters/grep  
I search in sites and found that installing contrib plugin will fix this . When i tried that am getting errors as well  
[lee@server1 logstash-1.5.0]$ bin/plugin install contrib  
Validating contrib  
Plugin contrib does not exist  
ERROR: Installation aborted, verification failed for contrib

could anyone please help me on this how to resolve.

Thanks in Advance

Regards  
Lee

---

<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:** [June 28, 2015, 5:54pm UTC](https://discuss.elastic.co/t/grep-in-logstash/24510/2 "2015-06-28T17:54:47Z")

</div>

Don't use the obsolete grep filter; use [conditionals](https://www.elastic.co/guide/en/logstash/current/configuration.html#conditionals) instead, e.g. like this to delete all messages where the `foo` field isn't equal to "bar":

```
if [foo] != "bar" {
  drop { }
}

```

---

<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:36am UTC](https://discuss.elastic.co/t/grep-in-logstash/24510/3 "2017-07-06T05:36:14Z")

</div>


