# Handle Error During Filebeat Ingestion

**URL:** <https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [July 5, 2024, 12:11pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611 "2024-07-05T12:11:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)\
**Post date:** [July 5, 2024, 12:11pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/1 "2024-07-05T12:11:19Z")

</div>

Hi Team,

We had a requirement that when Filebeat reads the records from CSV files from the directory below, it should capture any records that encounter errors . Is there a method available to redirect all error-related records to separate .err files instead of capturing them in the Filebeat log files?

```auto
 paths:
   - /cbdata/elastic/cb4lv1/cb4transv4/*.csv # path to your CSV file

```

**Note** :- If we made log level in debug mode it will capture error in same log file but log file size will be huge.

Thanks,  
Debasis

---

<div class="post-metadata">

**Author:** ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)\
**Post date:** [July 8, 2024, 2:47pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/2 "2024-07-08T14:47:53Z")

</div>

Any advise on the above request.

Thanks,  
Debasis

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 8, 2024, 3:06pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/3 "2024-07-08T15:06:50Z")

</div>

It is not really clear what exactly you want to do and what is your issue.

Can you provide more context?

You want to exclude error lines from your csv? Or capture just the error lines?

---

<div class="post-metadata">

**Author:** ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)\
**Post date:** [July 9, 2024, 5:42am UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/4 "2024-07-09T05:42:14Z")

</div>

> [@leandrojmp](#):
>
> You want to exclude error lines from your csv? Or capture just the error lines?

Yes, during processing of csv files the error records should capture in .err files with failure reason so that support team later will go-through those records.

Thanks,  
Debasis

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 9, 2024, 12:06pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/5 "2024-07-09T12:06:25Z")

</div>

> [@Debasis\_Mallick](#):
>
> Yes, during processing of csv files the error records should capture in .err files with failure reason so that support team later will go-through those records.

I'm sorry, but what are those `.err` files, what is generating it? Are you reading them with filebeat or you are talking about errors from the filebeat process? It is still not clear.

In the configuration you shared you are only looking to `.csv` files, so it is not clear what those `.err` files are.

Please provide context and examples.

---

<div class="post-metadata">

**Author:** ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)\
**Post date:** [July 9, 2024, 12:59pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/6 "2024-07-09T12:59:54Z")

</div>

Hi @leandrojmp , The requirement is as below.

We will receive customer data in CSV files, which will be processed through Filebeat. In cases where records in the CSV files cannot be processed by Filebeat, instead of printing those records in the Filebeat log, we aim to redirect them to a separate file called `filebeat.err`. This file will exclusively contain the error records.

Thanks,  
Debasis

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 9, 2024, 1:11pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/7 "2024-07-09T13:11:11Z")

</div>

Now I got it.

Unfortunately this is not possible.

---

<div class="post-metadata">

**Author:** ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)\
**Post date:** [July 9, 2024, 2:23pm UTC](https://discuss.elastic.co/t/handle-error-during-filebeat-ingestion/362611/8 "2024-07-09T14:23:21Z")

</div>

Thanks for confirmation. Is there any way to find those error records from csv files after processing through filebeat.

Thanks,  
Debasis
