logstash-nginx.config 399 B

123456789101112131415161718192021222324252627282930
  1. input {
  2. file {
  3. path => "/home/nginx.log"
  4. start_position => "beginning"
  5. sincedb_path => "/dev/null"
  6. }
  7. }
  8. filter {
  9. json {
  10. source => "message"
  11. }
  12. geoip {
  13. source => "remote_ip"
  14. }
  15. useragent {
  16. source => "agent"
  17. target => "useragent"
  18. }
  19. }
  20. output {
  21. elasticsearch {
  22. hosts => ["http://es:9200"]
  23. index => "nginx"
  24. }
  25. stdout {
  26. codec => rubydebug
  27. }
  28. }