# Filebeat holding the file and not allowing the daily job to replace

**URL:** <https://discuss.elastic.co/t/filebeat-holding-the-file-and-not-allowing-the-daily-job-to-replace/154328>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 28, 2018, 9:06am UTC](https://discuss.elastic.co/t/filebeat-holding-the-file-and-not-allowing-the-daily-job-to-replace/154328 "2018-10-28T09:06:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uttam](https://avatars.discourse-cdn.com/v4/letter/u/bc79bd/32.png) [@Uttam](https://discuss.elastic.co/u/Uttam)\
**Post date:** [October 28, 2018, 9:06am UTC](https://discuss.elastic.co/t/filebeat-holding-the-file-and-not-allowing-the-daily-job-to-replace/154328/1 "2018-10-28T09:06:27Z")

</div>

Hi there,

Currently we are having an issue while creating a new process to send data from SQL table to Kafka. We created 2 SQL agent jobs, each to create(replaces same file daily) the a file daily on our server which filebeat need to pick and send to Kafka. Most of the flow is working as expected but for one issue. SQL agent job is failing as the file is held by FIlebeat. These jobs are completing fine if the filebeat is in stopped state. Tried close\_eof, close\_inactive with no luck. We are using 6.4.2 version. Could anyone help us on this issue

P.S. As of now the only solution we can think of after multiple tests is to stop and start the filebeat daily during these jobs run using windows task schedular.

Thanks  
Uttam

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [October 29, 2018, 6:18pm UTC](https://discuss.elastic.co/t/filebeat-holding-the-file-and-not-allowing-the-daily-job-to-replace/154328/2 "2018-10-29T18:18:12Z")

</div>

@Uttam those options should work. Have you tried running with the `-once` option? You can read the documentation for it [here](https://www.elastic.co/guide/en/beats/filebeat/current/command-line-options.html#run-command).

That seems like the right match for your use case.

---

<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 26, 2018, 6:18pm UTC](https://discuss.elastic.co/t/filebeat-holding-the-file-and-not-allowing-the-daily-job-to-replace/154328/3 "2018-11-26T18:18:14Z")

</div>

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