[elk@outcheck235 ~]$ more /usr/share/logstash/etc/tomcat.conf input { redis { host => "127.0.0.1" port => 6379 data_type => "list" key => "tomcat:redis" codec => "json" batch_count => 10 threads => 8 } } output { elasticsearch { hosts => ["127.0.0.1:9200"] codec => "json" user => "elastic" workers => 4 password => "changeme" index => "tomcat-%{type}" } }
客戶端:
[tomcat@wztomcat01 ~]$ more /usr/share/logstash/etc/tomcat.conf input { file { path => ["/software/tomcat7072/logs/*.out"] type => "wz_01" codec => multiline { pattern => "^%{TIMESTAMP_ISO8601}" negate => true what => "previous" } } } output { redis { host => "10.1.0.235" port => 6379 data_type => "list" key => "tomcat:redis" codec => "json" batch => true batch_events => 10 batch_timeout => 30 } }