I am using logstash as means of backup tool for the logs of my application. The conf file i created is simply an input with a file plugin and an output with a file plugin.
So basically i have a shell script running which keeps updating the temp file (overwrites) with the content of application log file. The logstash will now copy the lines from input to output. There maybe a case where the log file of the appilcation is cleared of the entire content and starts appending new lines from the beginning.
So is the purpose of using the logstash to copy the unique lines off of the temp file to back up file. But the problem is......
input
{
file
{
path => "C:\Users\Desktop\temp.txt"
start_position => "beginning"
}
}
output
{
stdout { codec => line { format => "%{message}"} }
file
{
codec => line { format => "%{message}"}
path => "C:\Users\Desktop\backup.txt"
}
}
.....While each line being copied into my output file, they are not in order.
How to make it copy sequentially?
Below is the input and output i got running the logstash conf as given above!
I have one query though, if i have say 2-3 conf files will the number of workers affect both the conf files of the pipeline?
Yes. Logstash doesn't care how you split your configuration into separate files. When the configuration file parser reads them they just get concatenated anyway.
Can we have different workers for different conf files?
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.