美文网首页
2019-08-12 Logstash 收集多个日志文件存放到不

2019-08-12 Logstash 收集多个日志文件存放到不

作者: 刘明_d589 | 来源:发表于2019-08-12 21:25 被阅读0次

    在logstash配置文件中,可以使用不同的type指定每个输入。
    然后在过滤器中可以使用if来区分不同的处理,
    并且在输出端可以使用“if”输出到不同的目的地。

    input {
        file {
                type => "technical"
                path => "/home/technical/log"
        }
        file {
                type => "business"
                path => "/home/business/log"
        }
    } 
    filter {
        if [type] == "technical" {
                # processing .......
        }
        if [type] == "business" {
                # processing .......
        }
    }
    output {
        if [type] == "technical" {
                # output to gelf
        }
        if [type] == "business" {
                # output to elasticsearch
        }
    }
    

    参考(https://codeday.me/bug/20170716/38088.html

    相关文章

      网友评论

          本文标题:2019-08-12 Logstash 收集多个日志文件存放到不

          本文链接:https://www.haomeiwen.com/subject/ydbpjctx.html