logstash同步文件到es

本文档介绍了如何使用Logstash将单个和多个文本文件同步到Elasticsearch。通过配置文件analysis.conf,启动Logstash即可完成数据迁移。
摘要由CSDN通过智能技术生成

单文件文本同步到ES

input {
    file {
        path=> [ "C:/JWD/logs/*.log" ]
        #path=> [ "C:/JWD/server/nginx/logs/*.log",
        #    "C:/JWD/server/Debug/log/*.log" ]
        start_position => beginning
        stat_interval => 1 #设置多长时间检测文件是否修改 默认是1s
        #tags => "test" #添加标签
        #设置多长时间扫描目录,发现新文件
        discover_interval => 15
        # 设置监听间隔 各字段含义(从左至右)分、时、天、月、年,全为*默认含义为每分钟都更新
    }
}

filter {
    json{
        source => "message"
    }
    mutate{
        remove_field => ["message"]
        #add_field => {"test"=>"test"}
    }
#    mutate{
#		remove_field => ["host","path","message","@timestamp","@version"]
#    }
}
#https://blog.csdn.net/zhousenshan/article/details/81023857
#https://blog.csdn.net/yelllowcong/article/details
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值