logstash-input-file icon indicating copy to clipboard operation
logstash-input-file copied to clipboard

[windows] sincedb_write compains about permissions on first execution

Open jsvd opened this issue 10 years ago • 0 comments

The first time sincedb is written, it prints an error message, but works. Test scenario below:

config:

input { file  {
 path => "c:\test\teste.txt" 
 start_position => "beginning"
 sincedb_path => "c:\test\meh"
 }
}
output { stdout { codec => rubydebug } }

sincedb_file c:\test\meh doesn't exit:

C:\logstash-1.5.0.rc2>dir c:\test\meh
 Volume in drive C has no label.
 Volume Serial Number is 1C3E-1A1F

 Directory of c:\test

File Not Found

C:\logstash-1.5.0.rc2>dir c:\test\meh.new
 Volume in drive C has no label.
 Volume Serial Number is 1C3E-1A1F

 Directory of c:\test

File Not Found

run first time, write line to file, save, see it printed, exit logstash

C:\logstash-1.5.0.rc2>bin\logstash -f "c:\test\config.txt"
Logstash startup completed
{
       "message" => "teste\r",
      "@version" => "1",
    "@timestamp" => "2015-03-06T12:17:20.290Z",
          "host" => "Jsvd-VAIO",
          "path" => "c:\\test\\teste.txt"
}
←[33mSIGINT received. Shutting down the pipeline. {:level=>:warn}←[0m^
CTerminate batch job (Y/N)? ←[33m_sincedb_write rename/sync failed: c:\test\meh.
new -> c:\test\meh: Permission denied - c:\test\meh.new or c:\test\meh {:level=>
:warn}←[0m
Logstash shutdown completed

^C

An error message is printed. The sincedb file was created:

C:\logstash-1.5.0.rc2>dir c:\test\meh
 Volume in drive C has no label.
 Volume Serial Number is 1C3E-1A1F

 Directory of c:\test

06-03-2015  12:17                32 meh
               1 File(s)             32 bytes
               0 Dir(s)  18.763.636.736 bytes free

Relaunching logstash the message isn't written again, so the save point worked. Writing a second message "teste2" works:

C:\logstash-1.5.0.rc2>bin\logstash -f "c:\test\config.txt"
Logstash startup completed
{
       "message" => "teste2\r",
      "@version" => "1",
    "@timestamp" => "2015-03-06T12:17:56.209Z",
          "host" => "Jsvd-VAIO",
          "path" => "c:\\test\\teste.txt"
}
^C←[33mSIGINT received. Shutting down the pipeline. {:level=>:warn}←[0m
Logstash shutdown completed
Terminate batch job (Y/N)?
^C
C:\logstash-1.5.0.rc2>

jsvd avatar Mar 06 '15 12:03 jsvd