# Logstash is not pick up updated logs in newly created Log file with a same name after backup

**URL:** <https://discuss.elastic.co/t/logstash-is-not-pick-up-updated-logs-in-newly-created-log-file-with-a-same-name-after-backup/199620>\
**Category:** Logstash\
**Created:** [September 16, 2019, 9:26am UTC](https://discuss.elastic.co/t/logstash-is-not-pick-up-updated-logs-in-newly-created-log-file-with-a-same-name-after-backup/199620 "2019-09-16T09:26:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldeepak](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@ldeepak](https://discuss.elastic.co/u/ldeepak)\
**Post date:** [September 16, 2019, 9:26am UTC](https://discuss.elastic.co/t/logstash-is-not-pick-up-updated-logs-in-newly-created-log-file-with-a-same-name-after-backup/199620/1 "2019-09-16T09:26:19Z")

</div>

Hi Team,

Please help me on below topic.

Logstash is not able to read updated logs after creating a new log file with the same and putting old log file as a backup file, this issue i had faced in windows.

please find below information for your reference.

1. Maximum size set for log file is 5MB.
2. Once 5MB gets full than new log file will create with same name and updated withe new logs in same file.
3. Newly created logfile is not picking up by logstash.
4. older file gets rename with current timestamp and saved as a backup.

please let me know in case of any extra information required for your analysis.

Thanks in advance.  
Deepak Lohar  
[Deepaklohar275@gmail.com](mailto:Deepaklohar275@gmail.com)

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [September 16, 2019, 9:56am UTC](https://discuss.elastic.co/t/logstash-is-not-pick-up-updated-logs-in-newly-created-log-file-with-a-same-name-after-backup/199620/2 "2019-09-16T09:56:50Z")

</div>

Hi @ldeepak,

> [@ldeepak](#):
>
> please let me know in case of any extra information required for your analysis.

Could you please share your logstash input plugin configuration for more understanding?

Meanwhile, You need to set some parameter in your input plugin to read the file again from beginning. Please refer below post as they have explained in details how the input plugin works.

> [@Importing the same file](https://discuss.elastic.co/t/importing-the-same-file/120716):
>
> Hi, I just have a conceptual question about how logstash import same files. Let's say I have done with the previous data ingesting. I terminated the process of logstash after that.And I do not change the data source file or corresponding config file. They are exactly same as before. If I restart the logstash with the same config setting, would the data be replaced by the new one(even if they are same) or logstash automatically recognizes they are same so it will not import any new data?

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![ldeepak](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@ldeepak](https://discuss.elastic.co/u/ldeepak)\
**Post date:** [September 19, 2019, 5:14am UTC](https://discuss.elastic.co/t/logstash-is-not-pick-up-updated-logs-in-newly-created-log-file-with-a-same-name-after-backup/199620/3 "2019-09-19T05:14:06Z")

</div>

Hi Harsh,

Thanks for your reply, here I am facing some different issue.

I have go through the post shared by you and below is my understanding.  
In this They were discussing about file appending new log entries and we can keep track on current event ingested Logstash using SinceDB, as sincedb is already implemented in input section kindly check below.

Issue which i am facing that logstash is not able to read the logs as file is not getting append here but complete file is moved as a backup once 5MB gets filled and same file is start updating from 1st line at this time logstash is not able to pick the logs.

As requested please find input section below.

**input {**  
\*\* file {\*\*  
\*\* path =\> ["LogFilePath"]\*\*  
\*\* start\_position =\> "beginning" \*\*  
\*\* codec =\> multiline{\*\*  
\*\* pattern =\> "%{NUMBER:Num} %{YEAR}-%{MONTHNUM}-%{MONTHDAY}"\*\*  
\*\* negate =\> true\*\*  
\*\* what =\> "previous"\*\*  
\*\* } \*\*  
\*\* add\_field =\> "Extra Field added to the logs" \*\*  
\*\* sincedb\_path =\> "SinceDB File Path" \*\*  
\*\* type =\> "Describing type of logs" \*\*  
\*\* }\*\*  
**}**

Kindly let me know if above description is giving the clear understanding.

Thanks  
Deepak

---

<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:** [October 17, 2019, 5:14am UTC](https://discuss.elastic.co/t/logstash-is-not-pick-up-updated-logs-in-newly-created-log-file-with-a-same-name-after-backup/199620/4 "2019-10-17T05:14:09Z")

</div>

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