首页 > 其他 > 详细

Logstash-input-file 配置

时间:2021-01-07 19:04:57      阅读:23      评论:0      收藏:0      [点我收藏+]

在windows下,新建一个 config_file.conf 配置文件 

开始logstash的时候,新建一个  run_file.bat 批处理,内容是 logstash -f config_file.conf   

运行 run_file.bat 批处理文件就行了

 

 file.txt 文件内容

{"name": "zhangsan", "age": 21, "addr": "中国 北京"}
{"name": "lisi", "age":20,"addr":"美国"}
{"name": "wangwu","age":19,"addr":"beijing"}

 

 config_file.conf 文件配置

input {
    file {
        path => ["D:/tmp/file.txt"]
        start_position => "beginning"
        codec => "json"
    }
}
filter {
    
}
output {
    stdout {}
}

 注意 路径的 / 

 

 

官方配置说明地址:https://www.elastic.co/guide/en/logstash/7.1/plugins-inputs-file.html#plugins-inputs-file-start_position

 

Logstash-input-file 配置

原文:https://www.cnblogs.com/myfqm/p/14247024.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!