# Extracting data from logs using Filebeat

**URL:** https://discuss.elastic.co/t/extracting-data-from-logs-using-filebeat/153083
**Category:** Beats
**Tags:** filebeat
**Created:** [October 18, 2018, 10:50pm UTC](https://discuss.elastic.co/t/extracting-data-from-logs-using-filebeat/153083 "2018-10-18T22:50:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![merceskoba](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@merceskoba](https://discuss.elastic.co/u/merceskoba)
#### Post date: [October 18, 2018, 10:50pm UTC](https://discuss.elastic.co/t/extracting-data-from-logs-using-filebeat/153083/1 "2018-10-18T22:50:23Z")

</div>

Hello dear,  
My company is using Scalyr for monitoring logs. Now, i am making the POC using Graylog2.  
In Scalyr, there is a scalyr agent that manage logs before send to Graylog.  
For example,

> {  
> path: “/var/log/nginx/\*.access.log”,  
> attributes: {parser: “accessLog”, serverType: “nginx”},  
> sampling\_rules: [  
> { match\_expression: " HTTP/\d+?.\d+?" (?:402|405|410|429|(2|3)[0-9]{2}) ", sampling\_rate: 0 }  
> ]  
> }

sampling\_rate: 0, it means the log will not be sent to Scalyr.  
I think Filebeat is doing the same thing like the Scalyr agent.

> #exclude\_lines: ['^DBG']  
> #include\_lines: ['^ERR', '^WARN']

Are those 2 lines the right answer to make Filebeat doing the same thing like Scalyr agent ?  
Or do you have other opinions ?  
Thank you

---

<div class="post-metadata">

### Author: ![merceskoba](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@merceskoba](https://discuss.elastic.co/u/merceskoba)
#### Post date: [October 19, 2018, 9:11am UTC](https://discuss.elastic.co/t/extracting-data-from-logs-using-filebeat/153083/2 "2018-10-19T09:11:18Z")

</div>

Bump 🙂

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [October 19, 2018, 12:55pm UTC](https://discuss.elastic.co/t/extracting-data-from-logs-using-filebeat/153083/3 "2018-10-19T12:55:05Z")

</div>

exclude\_lines/include\_lines use regular expressions. If you always want to drop by the regex, then `exclude_lines` seems to be your setting.

---

<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: [November 16, 2018, 1:08pm UTC](https://discuss.elastic.co/t/extracting-data-from-logs-using-filebeat/153083/4 "2018-11-16T13:08:37Z")

</div>

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