如下所示进行设置
wget https://artifacts.elastic.co/downloads/logstash/logstash-6.6.2.deb
sudo dpkg -i logstash-6.6.2.deb
sudo systemctl enable logstash.service
sudo systemctl start logstash.service
并且我添加了如下的管道脚本
input {
file {
path => "/root/dev/Intuseer-PaaS/backend/airound_sv_logs.log"
start_position => "beginning"
}
}
output {
stdout {}
file {
path => "/root/dev/output/output-%{+YYYY-MM-dd}.log"
}
}
日志文件如下所示
timestamp, server_cpu, server_memory_used, server_memory_free, process_cpu, process_memory
1582787287, 1, 1176, 2759, 0, 9.05
1582787288, 1, 1176, 2759, 1, 8.97
1582787289, 2, 1176, 2759, 0, 9.04
1582787290, 1, 1177, 2758, 0, 8.98
1582787291, 0, 1176, 2759, 1, 9.04
1582787292, 1, 1176, 2759, 0, 8.96
1582787293, 1, 1177, 2758, 0, 9.03
1582787294, 1, 1176, 2759, 1, 9.08
1582787295, 0, 1177, 2758, 0, 9.02
1582787296, 1, 1176, 2759, 1, 9.05
我已经尝试了很多次才能在本地目录上获取此日志。我检查了logstash的状态。但是下面没有变化。还没有创建output-%。log文件。
因此,总而言之,一切正常,但是由于您没有在日志中看到任何东西,因此您认为它没有任何作用。添加--debug
确认一切正常。
不过有几点注意事项:
sincedb_path
,否则您将面临无法重复处理文件的风险csv
filter来分析您的行。