Close Csv File when Logstash is run as a windows service

Hello Community,

iam very new in this topic. I start a windows service via nssm.exe to observe a file for a csv to start the logstash.bat and specified config.

Now i have the problem that after the logstash is triggered. The csv file is still in use. How can i close the csv file after logstash is finished with the csv. Second question is where, and did i need additional plugins?

Where: In Config file or in arguments via nssm.exe?

best regards

Bernd

If you are using a file input in tail mode then logstash will keep the file open and tail it forever. You may be able to use read mode. What does your configuration look like.

input {
	file {
		path => "Q:/DATA/Test/Logstash/*.csv"
		start_position => "beginning"
		sincedb_path => "Q:/DATA/Test/Logstash/sincedb"
	}
}
filter {
	csv {
		separator => ";"
		skip_header => "true"
		columns => ["testdata1","testdata2","Date"]	
	}

	
	date {
		match => ["Date","yyyyMMddHHmmss" ]
		target => "Date"
	}
	
	
	
}
output {	
	elasticsearch {
        hosts => ["elastictest:9200"]
        index => "test"      
	}
}

OK, you are using tail mode, so logstash will keep the file open forever.

thx solved i added close_older

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