# How to search log line for a specific pattern format

**URL:** <https://discuss.elastic.co/t/how-to-search-log-line-for-a-specific-pattern-format/196977>\
**Category:** Logstash\
**Created:** [August 27, 2019, 4:41pm UTC](https://discuss.elastic.co/t/how-to-search-log-line-for-a-specific-pattern-format/196977 "2019-08-27T16:41:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [August 27, 2019, 5:04pm UTC](https://discuss.elastic.co/t/how-to-search-log-line-for-a-specific-pattern-format/196977/2 "2019-08-27T17:04:39Z")

</div>

Use grok. grok patterns are not anchored, so they will find the date and time anywhere in the line

```
    grok {
        break_on_match => false
        match => { "message" => ["\b(?<date>\d{2}/\d{2}/\d{4})\b", "\b(?<time>\d{2}:\d{2}:\d{2})\b"] }
    }
```

---

_[View the full topic](https://discuss.elastic.co/t/how-to-search-log-line-for-a-specific-pattern-format/196977)._
