自动化运维之日志系统Logstash实践JAVA(六)

6.3Logstach收集java日志

es是java服务,收集es需要注意换行问题 
1.编写收集Elasticsearch访问日志

 
    1. [root@linux-node3 conf.d]# cat java.conf
    2. input {
    3. file {
    4. type => "access_es"
    5. path => "/var/log/elasticsearch/xuliangwei.log"
    6. codec => multiline {
    7. pattern => "^["
    8. negate => true
    9. what => "previous"
    10. }
    11. }
    12. }
    13. output {
    14. redis {
    15. host => "192.168.90.204"
    16. port => "6379"
    17. db => "6"
    18. data_type => "list"
    19. key => "access_es"
    20. }
    21. }
原文地址:https://www.cnblogs.com/chenshengqun/p/8011895.html