代码语言:javascript复制
input {
file {
path => ["/data/logs/nginx/201/*.log"]
type => "test-log"
start_position => "beginning"
codec => "json"
}
}
output {
elasticsearch {
hosts => "192.168.56.201:9200"
index => "nginx-201"
}
}
更多参考:https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html