# Exclude the line of the log when a non desired value is found

**URL:** <https://discuss.elastic.co/t/exclude-the-line-of-the-log-when-a-non-desired-value-is-found/208365>\
**Category:** Logstash\
**Created:** [November 18, 2019, 6:01pm UTC](https://discuss.elastic.co/t/exclude-the-line-of-the-log-when-a-non-desired-value-is-found/208365 "2019-11-18T18:01:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Incauto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incauto/32/60149_2.png) [@Incauto](https://discuss.elastic.co/u/Incauto)\
**Post date:** [November 18, 2019, 6:01pm UTC](https://discuss.elastic.co/t/exclude-the-line-of-the-log-when-a-non-desired-value-is-found/208365/1 "2019-11-18T18:01:15Z")

</div>

Hi, is there a way to exclude a log line if certain value is found?

if the percent field receive a number, filter the log.

```
ex: Kerberos 12

```

if the percent field receive other type dont process the line

```
ex: Deimos n/a

```

using this grok as an example

```
% {DATA:name} %{NUMBER:percent}

```

I ask this because some times in my logs appears "n/a" instead of a number for the percentage field

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 18, 2019, 11:32pm UTC](https://discuss.elastic.co/t/exclude-the-line-of-the-log-when-a-non-desired-value-is-found/208365/2 "2019-11-18T23:32:42Z")

</div>

If I understand the ask correctly then

```
if [percent] == "n/a" { drop {} }

```

would work.

---

<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:** [December 16, 2019, 11:32pm UTC](https://discuss.elastic.co/t/exclude-the-line-of-the-log-when-a-non-desired-value-is-found/208365/3 "2019-12-16T23:32:43Z")

</div>

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