# How to get specific pieces of log instead of entire log

**URL:** <https://discuss.elastic.co/t/how-to-get-specific-pieces-of-log-instead-of-entire-log/121944>\
**Category:** Logstash\
**Created:** [February 28, 2018, 9:25pm UTC](https://discuss.elastic.co/t/how-to-get-specific-pieces-of-log-instead-of-entire-log/121944 "2018-02-28T21:25:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Criviere](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@Criviere](https://discuss.elastic.co/u/Criviere)\
**Post date:** [February 28, 2018, 9:25pm UTC](https://discuss.elastic.co/t/how-to-get-specific-pieces-of-log-instead-of-entire-log/121944/1 "2018-02-28T21:25:47Z")

</div>

Hello, I was wondering on how I would go about taking only specific pieces of data from a log instead of passing the entire log to elasticsearch. Is there a way to currently do this?

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [February 28, 2018, 9:29pm UTC](https://discuss.elastic.co/t/how-to-get-specific-pieces-of-log-instead-of-entire-log/121944/2 "2018-02-28T21:29:23Z")

</div>

Logstash has to read the entire file, but you can use filters to drop data you don't want

> **[Drop filter plugin | Logstash Reference \[8.11\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-drop.html)**

> filter{  
> if [message] =~/DEBUG/) {  
> drop{}  
> }  
> }

---

<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:** [March 28, 2018, 9:29pm UTC](https://discuss.elastic.co/t/how-to-get-specific-pieces-of-log-instead-of-entire-log/121944/3 "2018-03-28T21:29:27Z")

</div>

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