[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 }
}
logstash 采集springboot 错误日志配置
最新推荐文章于 2023-09-01 13:53:01 发布