zoukankan      html  css  js  c++  java
  • logstash 采集springboot 错误日志配置

    [elk@master001 config]$ cat logstash-log.conf 
    # Sample Logstash configuration for creating a simple
    # Beats -> Logstash -> Elasticsearch pipeline.
    
    input {
      tcp {
        port => 5044
        codec => json_lines
      }
    }
    
    
    filter {
    
      if [LOGLEVEL] == "DEBUG" {
        drop {}
      }
      if [LOGLEVEL] == "INFO" {
        drop {}
      }
      if [LOGLEVEL] == "WARN" {
        drop {}
      }
    
        ruby {
            code => "event.set('timestamp', event.get('@timestamp').time.localtime + 8*60*60)"
        }
        ruby {
            code => "event.set('@timestamp',event.get('timestamp'))"
        }
        mutate {
            remove_field => ["timestamp"]
        }
    }
    
    
    output {
      elasticsearch {
        hosts => ["http://localhost:9200"]
        index => "%{[appName]}-%{+YYYY.MM.dd}"
        #user => "elastic"
        #password => "changeme"
      }
    
      stdout { codec => rubydebug }
    }
    

      

  • 相关阅读:
    npm
    模块化开发
    Html input 标签
    H5 移动端布局
    Mysql指令
    php面向对象
    git指令
    css3 属性
    如何渲染数据
    angular 服务
  • 原文地址:https://www.cnblogs.com/xiaojf/p/14442756.html
Copyright © 2011-2022 走看看