# How can filebeat crawling and send to kafka in real time

**URL:** <https://discuss.elastic.co/t/how-can-filebeat-crawling-and-send-to-kafka-in-real-time/158706>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 29, 2018, 8:03am UTC](https://discuss.elastic.co/t/how-can-filebeat-crawling-and-send-to-kafka-in-real-time/158706 "2018-11-29T08:03:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruiyi\_Luo](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@Ruiyi\_Luo](https://discuss.elastic.co/u/Ruiyi_Luo)\
**Post date:** [November 29, 2018, 8:03am UTC](https://discuss.elastic.co/t/how-can-filebeat-crawling-and-send-to-kafka-in-real-time/158706/1 "2018-11-29T08:03:08Z")

</div>

However I optimize with various config params. There are always 3 seconds delay.  
My filebeat.yml as below:

filebeat.inputs:

- type: log  
enabled: true  
fields:  
log\_topics: ngaudio\_test  
paths:

- type: log  
enabled: true  
fields:  
log\_topics: ngappuse\_test  
paths:

filebeat.config.modules:  
path: ${path.config}/modules.d/\*.yml  
reload.enabled: false

queue.mem:  
events: 4096  
flush.min\_events: 512  
flush.timeout: 0s

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [November 30, 2018, 11:22am UTC](https://discuss.elastic.co/t/how-can-filebeat-crawling-and-send-to-kafka-in-real-time/158706/2 "2018-11-30T11:22:37Z")

</div>

What is your requirement you mean by real time? Filebeat is not able to collect logs in real time, only in near real time.  
You could decrease `scan_frequency` to `1s`, so Filebeat checks for new changes every second.

---

<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:** [December 28, 2018, 11:22am UTC](https://discuss.elastic.co/t/how-can-filebeat-crawling-and-send-to-kafka-in-real-time/158706/3 "2018-12-28T11:22:48Z")

</div>

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