output{
if ("Format log different" in [New log format]) {
file {
path => "D:/elastic_stack/LOGS/other/test-%{+YYYY-MM-dd}.txt"
codec => line { format => "custom format: %{message}"}
}
}
}
So in the same time i want to delete the file that exist under D:\elastic_stack\LOGS\CMS_LOGS\ i mean how to delete file in the output block in logstash after creating another file like i did
Thanks for the reply Cad
indeed my output filebeat is kafka so my logstash input is kafka it's not possible to delete a file after filtring i mean in the output block ?
logstash.conf
The file added successfully, i just want to delete the file when filebeat reads it exactly under D:\elastic_stack\LOGS\CMS_LOGS* I hope you understand me.
I added mode => "read" file_completed_action => "delete" it gives me an error Unknown setting 'mode' for file Unknown setting 'file_completed_action' for file
I have 5 dirs in each dir i have files in different format so i used filebeat to read all files in that 5 dir and i did the multiline to split them each log and send those logs to kafka then logstash to do the filtering in each log then i send it to Elasticsearch.
And delete file, I just want it if there is new log format in this directory, do it automatically in another directory and delete it from directory 0
Filebeat - collects logs and forwards them to a Kafka topic.
Kafka - brokers the data flow and queues it.
Logstash - aggregates the data from the Kafka topic, processes it and ships to Elasticsearch.
Sorry fo the late response.
Your architecture don't look wrong for me, i juste wanted to know if it was possible to you to only use ELK use the remove_file option of logstash.
I don't understand this line, you wnat to remove files under specific conditions ?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.