Logstash not flushing file to output directory


(shwetabh) #1

Hi,
I am trying logstash in windows filesystem where I am trying to put file from one directory to other directory.

My logstash.conf file is : -
input {
file {
path => "C:/logstash/in.log"
}
}
output {
file {
path => "C:/logstashnew/outlog.log"
}
}

I have created C:/logstash/in.log file.when I try to run logstash by issuing:
logstash/bin> logstash -f /logstash.conf
but file was not copied to "C:/logstashnew/outlog.log"

Log generated:

C:\logstash-6.4.1\logstash-6.4.1\bin>logstash -f logstash.conf
Sending Logstash logs to C:/logstash-6.4.1/logstash-6.4.1/logs which is now configured via log4j2.properties
[2018-09-22T16:21:56,414][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-09-22T16:21:57,480][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.4.1"}
[2018-09-22T16:22:01,550][INFO ][logstash.pipeline ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2018-09-22T16:22:02,708][INFO ][logstash.inputs.file ] No sincedb_path set, generating one based on the "path" setting {:sincedb_path=>"C:/logstash-6.4.1/logstash-6.4.1/data/plugins/inputs/file/.sincedb_d7c2d93c7e9416388d9cdd03920ef37e", :path=>["C:\logstash\in.log"]}
[2018-09-22T16:22:02,801][INFO ][logstash.pipeline ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x1309f6ab run>"}
[2018-09-22T16:22:02,911][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2018-09-22T16:22:02,949][INFO ][filewatch.observingtail ] START, creating Discoverer, Watch with file and sincedb collections
[2018-09-22T16:22:03,517][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}

Please guide


(Magnus B├Ąck) #2

How do you know that Logstash is reading anything from the input file? As you've configured it Logstash will only read new lines appended to the file. Check out the start_position option of the file input and read what its documentation says about sincedb.


(system) #3

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