配置logstash并且运行
代码语言:javascript复制[root@h102 etc]# cat logstash-filebeat-es-simple.conf
input {
stdin{}
beats{port => 5044}
}
output {
elasticsearch {
hosts=>"localhost:9200"
index=>"%{[@metadata][beat]}-%{ YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
stdout {codec=>rubydebug}
}
[root@h102 etc]#
[root@h102 etc]# /opt/logstash/bin/logstash -f logstash-filebeat-es-simple.conf
Settings: Default filter workers: 1
Logstash startup completed
{
"message" => "Dec 25 00:37:20 h102 init: tty (/dev/tty2) main process (2300) killed by TERM signal",
"@version" => "1",
"@timestamp" => "2016-01-05T07:52:48.994Z",
"beat" => {
"hostname" => "h102.temp",
"name" => "h102.temp"
},
"count" => 1,
"fields" => nil,
"input_type" => "log",
"offset" => 247376,
"source" => "/var/log/messages-20151230",
"type" => "log",
"host" => "h102.temp"
}
...
...