# Filtre logstash "if not"

**URL:** <https://discuss.elastic.co/t/filtre-logstash-if-not/140739>\
**Category:** Logstash\
**Created:** [July 19, 2018, 1:27pm UTC](https://discuss.elastic.co/t/filtre-logstash-if-not/140739 "2018-07-19T13:27:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asalma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asalma/32/32199_2.png) [@asalma](https://discuss.elastic.co/u/asalma)\
**Post date:** [July 19, 2018, 1:27pm UTC](https://discuss.elastic.co/t/filtre-logstash-if-not/140739/1 "2018-07-19T13:27:53Z")

</div>

Hi,

Can someone help me please :

When test my configuration, I have this error :

```auto
[2018-07-19T15:01:56,149][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

```

in this part of the file !!

```auto
    if !([Application] == "smtp" or [Application] == "smtps") {
      drop { }
    }

```

---

<div class="post-metadata">

**Author:** ![victor.nilsson](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@victor.nilsson](https://discuss.elastic.co/u/victor.nilsson)\
**Post date:** [July 19, 2018, 1:33pm UTC](https://discuss.elastic.co/t/filtre-logstash-if-not/140739/2 "2018-07-19T13:33:15Z")

</div>

Try

> if "smtp" not in [Application] or "smtps" not in [Application] {  
> drop { }  
> }

---

<div class="post-metadata">

**Author:** ![asalma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asalma/32/32199_2.png) [@asalma](https://discuss.elastic.co/u/asalma)\
**Post date:** [July 19, 2018, 1:36pm UTC](https://discuss.elastic.co/t/filtre-logstash-if-not/140739/3 "2018-07-19T13:36:36Z")

</div>

No, the problem begin in : if " ....

```auto
  else if [fields][log_type] == "paloalto_smtp" {
    csv{
      source => "data"
      columns => ["FUTURE_USE","Receive Time","Serial Number","Type","Threat/Content Type", "FUTURE_USE","Generated Time","src_ip","dst_ip","NAT Source IP", "NAT Destination IP$
    }
    if "
[2018-07-19T15:35:27,686][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
```

---

<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:** [July 19, 2018, 6:43pm UTC](https://discuss.elastic.co/t/filtre-logstash-if-not/140739/5 "2018-07-19T18:43:27Z")

</div>

The log message you quoted is just the final "something went bad, shutting down" message. The interesting log message comes before that. Seeing the complete configuration would also be helpful.

---

<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:** [August 16, 2018, 6:43pm UTC](https://discuss.elastic.co/t/filtre-logstash-if-not/140739/6 "2018-08-16T18:43:27Z")

</div>

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