Logstash logstash.conf 配置示例

新博客地址:https://blog.iaiot.com/logstash-conf.html

# Sample Logstash configuration for creating a simple
# File -> Logstash -> Elasticsearch pipeline.

input {
  file {
    path => "/data/nginx/logs/access.log"
  }
}

filter {
  mutate {
    add_field => [ "[fields][path]", "%{[path]}"]
	add_field => [ "message]", "%{[message]}"]
  }
}

output {
  elasticsearch {
    hosts => ["http://192.168.153.7:9200"]
	index => "test-logstash"
  }
}

input 配置参考:https://www.elastic.co/guide/en/logstash/current/input-plugins.html
output 配置参考:https://www.elastic.co/guide/en/logstash/current/output-plugins.html
filter 配置参考:https://www.elastic.co/guide/en/logstash/6.4/filter-plugins.html
Logstash Reference:https://www.elastic.co/guide/en/logstash/6.4/index.html

你可能感兴趣的:(Elasticsearch,Logstash)