logstash 安装与启动

官网下载java

https://www.elastic.co/cn/products/logstashruby

在logstash/config目录建立配置文件logstash.config内容以下elasticsearch

#配置收集规则
input {
  stdin {}
}


#配置过滤规则
filter {
    grok {
        match => {
            "message" => "%{WORD} %{IP:client} %{WORD}"
        }
    }
}
#配置输出规则
output {
     elasticsearch {
                hosts => ["10.116.69.4:9200" ]
                action => "index"
                codec => rubydebug
                index => "%{type}-%{+YYYY.MM.dd}"
                template_name => "%{type}"
        }
}

启动debug

nohup ./bin/logstash -f logstash.config &>nohup.log&code

相关文章
相关标签/搜索