logstash.conf 810 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. input {
  2. tcp {
  3. mode => "server"
  4. host => "0.0.0.0"
  5. port => 4560
  6. codec => json_lines
  7. type => "debug"
  8. }
  9. tcp {
  10. mode => "server"
  11. host => "0.0.0.0"
  12. port => 4561
  13. codec => json_lines
  14. type => "error"
  15. }
  16. tcp {
  17. mode => "server"
  18. host => "0.0.0.0"
  19. port => 4562
  20. codec => json_lines
  21. type => "business"
  22. }
  23. tcp {
  24. mode => "server"
  25. host => "0.0.0.0"
  26. port => 4563
  27. codec => json_lines
  28. type => "record"
  29. }
  30. }
  31. filter{
  32. if [type] == "record" {
  33. mutate {
  34. remove_field => "port"
  35. remove_field => "host"
  36. remove_field => "@version"
  37. }
  38. json {
  39. source => "message"
  40. remove_field => ["message"]
  41. }
  42. }
  43. }
  44. output {
  45. elasticsearch {
  46. hosts => "localhost:9200"
  47. index => "mall-%{type}-%{+YYYY.MM.dd}"
  48. }
  49. }