# Drop complete row or message

**URL:** <https://discuss.elastic.co/t/drop-complete-row-or-message/349415>\
**Category:** Logstash\
**Created:** [December 15, 2023, 6:21am UTC](https://discuss.elastic.co/t/drop-complete-row-or-message/349415 "2023-12-15T06:21:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kundan](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kundan](https://discuss.elastic.co/u/kundan)\
**Post date:** [December 15, 2023, 6:21am UTC](https://discuss.elastic.co/t/drop-complete-row-or-message/349415/1 "2023-12-15T06:21:27Z")

</div>

Hi,  
I want to drop full row based on one of the field. I am using following in filter.

```auto
filter {
        grok {
            match => {"message" => ["%{IP:ip} %{SPACE}\{user:%{USERNAME:UserId}\}"]}
        }
        date {
            locale => "en"
            timezone => "UTC"
            match => ["timestamp", "dd/MMM/yyyy:HH:mm:ss"]
            target => "@timestamp"
        }

        if "ANONYMOUS" in [UserId] {
            drop { }
        }
        else {
           }
        }

```

When I run, this, all log lines end up in kibana only difference is that all fields like ip and userID are -.

Also I want to process all log files in folder created after specific time. is there any filter for that?

---

<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:** [December 15, 2023, 7:08pm UTC](https://discuss.elastic.co/t/drop-complete-row-or-message/349415/2 "2023-12-15T19:08:38Z")

</div>

> [@kundan](#):
>
> only difference is

Only difference between what and what?

---

<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:** [January 12, 2024, 7:09pm UTC](https://discuss.elastic.co/t/drop-complete-row-or-message/349415/3 "2024-01-12T19:09:19Z")

</div>

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