Logstash管道无法与csvfile一起使用 [英] Logstash pipeline not working with csvfile

查看:76
本文介绍了Logstash管道无法与csvfile一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按如下所示进行设置

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

并且我添加了如下的管道脚本

and i added a pipeline script like below

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文件.

I've tried so many time to get this log on local directory. I checked the status of logstash. but It doesn't have change after below. aslo the output-%.log file wasn't made.

$ systemctl status logstash.service的结果

The result of $ systemctl status logstash.service

请帮助我.谢谢你.我正在尝试使用Logstash 6.6.2.我

Please help me. thank you. Im trying with logstash 6.6.2. I

推荐答案

因此,总的来说,一切正常,但是由于您在日志中没有看到任何内容,因此您认为它没有任何作用.添加-debug 确认一切正常.

So, in summary, everything was working, but since you didn't see anything in the log you assumed it wasn't working. Adding --debug confirmed that everything was working properly.

不过,有几点注意事项:

A few notes, though:

  • 别忘了添加 sincedb_path ,否则您将面临无法重复重新处理文件的风险
  • 尽量不要在/root中做任何事情,因为运行Logstash的使用可能并不总是有权对该文件夹进行读/写操作
  • 利用 csv 过滤器以便分析您的行.
  • Don't forget to add sincedb_path otherwise you run the risk of not being able to reprocess your file repeatedly
  • Try not to do stuff in /root as the use under which Logstash runs might not always have the right to R/W that folder
  • Leverage the csv filter in order to parse your rows.

这篇关于Logstash管道无法与csvfile一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆