zoukankan      html  css  js  c++  java
  • logstash 的 配置文件

    [root@10-19-148-59 etc]# cat test_front_console.conf
    input {
        beats {
          type => beats
          port => 5077
        }
    }
    filter {
            if [type] == 'test-front' {
            multiline {
                    pattern => ".*##.*"
                    negate => true
                    what => "previous"
            }
                grok {
            patterns_dir => "/data/package/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-2.0.5/patterns"
                    match => {"message"=>"%{DATA:date} %{LOGLEVEL:LEVEL} %{JAVACLASS:class} %{NOTSPACE:thread} %{NOTSPACE:requestId} %{MSG:msg}"}
            remove_field => ['@version']
            remove_field => ['message']
            remove_field => ['offset']
            remove_field => ['source']
            remove_field => ['input_type']
            remove_field => ['beat']
    }
    }
            if [type] == 'test-esb' {
            multiline {
                    pattern => ".*##.*"
                    negate => true
                    what => "previous"
            }
            grok {
                    remove_field => ['@version']
                    remove_field => ['offset']
                    remove_field => ['source']
                    remove_field => ['input_type']
                    remove_field => ['beat']
            }
    }
    }
    
    output {
        if [type] == 'test-front' {
        elasticsearch {
           hosts => ["10.19.148.59:9200"]
               index => "test-front-%{+YYYY.MM.dd}"
        }
        stdout {
           codec => rubydebug
        }
    }
            if [type] == 'test-esb' {
            elasticsearch {
               hosts => ["10.19.148.59:9200"]
               index => "test-esb-%{+YYYY.MM.dd}"
            }
    }
    }

    添加下面一个正则表达式

    [root@10-19-148-59 patterns]# cat msg 
    MSG (.|
    |
    )*
    
  • 相关阅读:
    【刷题-LeetCode】165 Compare Version Numbers
    python 22 内置模块2
    python 21 内置模块
    python 20 模块,包,及开发目录规范
    python 19
    python 18 三元,生成,递推
    定时抓取数据并存入数据库
    抓取财报数据
    金币
    交换座位
  • 原文地址:https://www.cnblogs.com/smail-bao/p/6709963.html
Copyright © 2011-2022 走看看