# Logstash ignore logs grok filter

**URL:** https://discuss.elastic.co/t/logstash-ignore-logs-grok-filter/213578
**Category:** Logstash
**Created:** [January 2, 2020, 1:18pm UTC](https://discuss.elastic.co/t/logstash-ignore-logs-grok-filter/213578 "2020-01-02T13:18:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Aayush\_Agrawal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aayush_agrawal/32/56095_2.png) [@Aayush\_Agrawal](https://discuss.elastic.co/u/Aayush_Agrawal)
#### Post date: [January 2, 2020, 1:18pm UTC](https://discuss.elastic.co/t/logstash-ignore-logs-grok-filter/213578/1 "2020-01-02T13:18:55Z")

</div>

I want to capture the start time of a log, but if i use grok filter if there are some log with same info they all will be captured. How do i modify the filter as such it ignore rest of the logs with same pattern as soon as it find first match.  
for example i have logs like this and i want only start time and end time, so the first line and last line.

[DEBUG main : 01/01/2020-00:07:11.884 : ValidationUtil] Validating Path:/opt/cford-app/  
[DEBUG main : 01/01/2020-00:07:11.885 : ValidationUtil] Validating Path:/dump/  
[DEBUG main : 01/01/2020-00:07:11.885 : ValidationUtil] Validating Path:/opt/middleware/  
[DEBUG main : 01/01/2020-00:07:11.887 : ValidationUtil] Validating Path:/dump/term  
[DEBUG main : 01/01/2020-00:07:11.889 : ValidationUtil] Validating Path:/opt/middleware2/

so result should be start time - 01/01/2020-00:07:11.884 , end time- 01/01/2020-00:07:11.889

---

<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: [January 2, 2020, 2:02pm UTC](https://discuss.elastic.co/t/logstash-ignore-logs-grok-filter/213578/2 "2020-01-02T14:02:19Z")

</div>

You might be able to do it with an aggregate filter.

---

<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 30, 2020, 2:02pm UTC](https://discuss.elastic.co/t/logstash-ignore-logs-grok-filter/213578/3 "2020-01-30T14:02:21Z")

</div>

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