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 }
    }
    

      

  • 相关阅读:
    第二周c语言PTA作业留
    2018第零次作业
    总结报告
    第14/15周作业
    第七周作业
    第六周作业
    第四次作业
    第三次作业
    大学第二次作业
    大学的第一次作业
  • 原文地址:https://www.cnblogs.com/xiaojf/p/14442756.html
Copyright © 2011-2022 走看看