Ovidiu Rudi
Ovidiu Rudi

Reputation: 190

Cannot listen file in logstash with absolute path

I have logstash installed on path: D:\WORK\ElasticSearch\logstash-2.0.0\bin and my apps write logs on path: D:\Logs

When I use logstash path to load logs "D:\WORK\ElasticSearch\logstash-2.0.0\bin" with this script i'm able to read it. input { file { path => ["\PlatformTest_*"] #discover_interval - How often (in seconds) we expand the filename patterns in the path option to discover new files to watch discover_interval => 20 #start_position - Choose where Logstash starts initially reading files: at the beginning or at the end start_position => "beginning" #stat_interval - How often (in seconds) we stat files to see if they have been modified. stat_interval => 2 } }

But when I use the real path of logs with this log, it don't work: input { file { path => ["D:\Logs\PlatformTest_*"] #discover_interval - How often (in seconds) we expand the filename patterns in the path option to discover new files to watch discover_interval => 20 #start_position - Choose where Logstash starts initially reading files: at the beginning or at the end start_position => "beginning" #stat_interval - How often (in seconds) we stat files to see if they have been modified. stat_interval => 2 } }

Also when I try relative path it don't work: input { file { path => ["\..\..\..\..\Logs\PlatformTest_*"] #discover_interval - How often (in seconds) we expand the filename patterns in the path option to discover new files to watch discover_interval => 20 #start_position - Choose where Logstash starts initially reading files: at the beginning or at the end start_position => "beginning" #stat_interval - How often (in seconds) we stat files to see if they have been modified. stat_interval => 2 } }

Any Idea?

Upvotes: 0

Views: 523

Answers (1)

Ovidiu Rudi
Ovidiu Rudi

Reputation: 190

Using forward slashes instead of backslashes.

input 
{
    file 
    {
        path => ["D:/Logs/PlatformTest_*"]
        #discover_interval - How often (in seconds) we expand the filename patterns in the path option to discover new files to watch
        discover_interval => 20
        #start_position - Choose where Logstash starts initially reading files: at the beginning or at the end
        start_position => "beginning"
        #stat_interval - How often (in seconds) we stat files to see if they have been modified. 
        stat_interval => 2
    }
}

Upvotes: 0

Related Questions