# Can't parse Linux OS generated log files in windows environment with file input plugin

**URL:** https://discuss.elastic.co/t/cant-parse-linux-os-generated-log-files-in-windows-environment-with-file-input-plugin/43209
**Category:** Logstash
**Created:** [March 2, 2016, 8:11am UTC](https://discuss.elastic.co/t/cant-parse-linux-os-generated-log-files-in-windows-environment-with-file-input-plugin/43209 "2016-03-02T08:11:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![guojingjing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guojingjing/32/8205_2.png) [@guojingjing](https://discuss.elastic.co/u/guojingjing)
#### Post date: [March 2, 2016, 8:11am UTC](https://discuss.elastic.co/t/cant-parse-linux-os-generated-log-files-in-windows-environment-with-file-input-plugin/43209/1 "2016-03-02T08:11:27Z")

</div>

Any one ran into this problem:  
**_log files generated by a Linux system which is stored as \*.log, can not be parsed in windows environment._**

Specifically, I have my logstash conf to read \*.log files in a folder: the Linux OS generated ones could not be parsed, and the windows can.  
I then tried to copy paste contents in the Linux generated log files in a new txt file and then it worked.

I can't figure out why. Does anyone know? Thanks!

My conf file is as follows:  
input {  
stdin {}  
file {  
path =\> "C:/1LOGS/test1/data/_/file_.log"  
start\_position =\> beginning  
}  
}

output {  
stdout {  
codec =\> rubydebug  
}  
}

---

<div class="post-metadata">

### Author: ![mick66](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mick66](https://discuss.elastic.co/u/mick66)
#### Post date: [March 2, 2016, 3:34pm UTC](https://discuss.elastic.co/t/cant-parse-linux-os-generated-log-files-in-windows-environment-with-file-input-plugin/43209/2 "2016-03-02T15:34:14Z")

</div>

Check this out:

[https://www.elastic.co/guide/en/logstash/current/plugins-codecs-plain.html](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-plain.html)

Add a charset to the plain codec on your input filter:

```
input {
  stdin {}
   file {
       path => "C:/1LOGS/test1/data/*/file*.log"
       start_position => beginning
       codec => plain {
           charset => '????'
      }
   }
}

```

Replace the ???? with a character set that is appropriate for your input file.

---

<div class="post-metadata">

### Author: ![guojingjing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guojingjing/32/8205_2.png) [@guojingjing](https://discuss.elastic.co/u/guojingjing)
#### Post date: [March 3, 2016, 8:16am UTC](https://discuss.elastic.co/t/cant-parse-linux-os-generated-log-files-in-windows-environment-with-file-input-plugin/43209/3 "2016-03-03T08:16:04Z")

</div>

Thanks for the detailed reply.

It turns out the cause to my problem is the fact that my log files are too old. The post I stumbled into helped:

> [@Logstash not showing any output (SOLVED)](https://discuss.elastic.co/t/logstash-not-showing-any-output-solved/28636):
>
> I'm starting off with Logstash, working through the tutorials. I find the plugin documentation very lacking for someone with no experience with logstash. Here is the config file I am starting with: input { file { path =\> "/Users/brad/Workspaces/unirisk.python/logstash/files/perflog.csv" start\_position =\> beginning } } output { stdout { } } I am running logstash on a Macbook Pro, version 1.5.4, installed via homebrew. My startup is: logstash -f test.conf This s…

As @Wayne_Taylor pointed out, the file plugin seems to have a default setting to not read any log events that are more than 24 hours old.

Is there any way to work around it?

Thanks!

---

<div class="post-metadata">

### Author: ![mick66](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mick66](https://discuss.elastic.co/u/mick66)
#### Post date: [March 3, 2016, 8:56am UTC](https://discuss.elastic.co/t/cant-parse-linux-os-generated-log-files-in-windows-environment-with-file-input-plugin/43209/4 "2016-03-03T08:56:33Z")

</div>

Take a look at this:

[https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html)

I think you need the `ignore_older` option, which should allow you to set a value less than the default 24 hours.

---

<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: [July 6, 2017, 5:08am UTC](https://discuss.elastic.co/t/cant-parse-linux-os-generated-log-files-in-windows-environment-with-file-input-plugin/43209/5 "2017-07-06T05:08:39Z")

</div>


