This is my first post. If it is not the right place, kindly redirect me to the correct place.
I want to first ship the log files from the remote server to the central sever "as it is" with out any formatting using logstash. Later on i will think of for Elastic search and generate dash board using Kibana .
To achieve that i did the following changes. Below config is coping all the logs under directory /var/log/*.log to /home/logstash/logs/test.log.
I want all the log files under directory /var/log/*.log should come under directory /home/logstash/logs/, instead of test.log but it is not working. For that i change the output section as below. Kindly correct me, how do i achieve this.
I changed both the option in filter but still i am getting out file %{filename}.log instead of all files which specified in logstash-forwarder.conf "/var/log/*.log"
I changed both the option in filter but still i am getting out file
%{filename}.log instead of all files which specified in
logstash-forwarder.conf "/var/log/*.log" I need all log files specified
under directory /var/log/ to ouput directory. /home/logstash/logs/
The name of the field containing the filename is file in the logstash-forwarder case (see below). It's Logstash that uses path. Hence, the grok filter to parse the file field instead.
We can try to help if you post additional details, including your configuration, the messages you do get, and what you expected to get. Just posting "it didn't work" is not the best way to get quick help.
Here is my initial configuration to achieve all the logs under directory /var/log/.log to ship /home/logstash/logs/.log. directory as it is without any formatting.
Post advise, removed filename field from the path field, change "path" to "file". Still i am getting output %{filename}.log under /home/logstash/logs/ instead of /home/logstash/logs/.log e.g on client server file /var/log/test.log should come as it is /home/logstash/logs/test.log on central server.
input {
lumberjack {
port => 5043
type => "logs"
ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt"
ssl_key => "/etc/pki/tls/private/logstash-forwarder.key"
}
}
filter {
grok {
match => { "file" => "/var/log/%{DATA:}.log" } == it was match => { "path" => "/var/log/%{DATA:filename}.log" }
}
}
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.