• elk 索引


    zjtest7-redis:/usr/local/logstash-2.3.4/config# cat logstash_agent.conf 
    input {
            file {
                    type => "nginx_access"
                    path => ["/usr/local/nginx/logs/test.access.log"]
            }
    }
    output {
            redis {
                    host => "localhost"
                    data_type => "list"
                    key => "logstash:redis"
                    port=>"6379"
                    password => "1234567"
            }
    }
    
    
    zjtest7-redis:/usr/local/logstash-2.3.4/config# cat logstash_indexer.conf 
    input {
            redis {
                    host => "localhost"
                    data_type => "list"
                    key => "logstash:redis"
                    type => "redis-input"
                    password => "1234567"
                    port =>"6379"
            }
    }
    output {
            elasticsearch {
                    hosts => "192.168.32.80:9200"
                    index => "nginx_acc"
            }
    		stdout {
    			codec => rubydebug
    		}
    }
    
    nginx配置;
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        log_format logstash '$http_host $server_addr $remote_addr [$time_local] "$request" '
                        '$request_body $status $body_bytes_sent "$http_referer" "$http_user_agent" '
                        '$request_time $upstream_response_time';
    
        #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
        #                  '$status $body_bytes_sent "$http_referer" '
        #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  /usr/local/nginx/logs/test.access.log  logstash;
    	
    	

    这里logstash配置对了,自动建索引


  • 相关阅读:
    algorithm
    jstl
    jsp
    cookie
    变量和方法调用过程中会出现的参数传递
    http请求
    weblogic 的安全域问题
    web service
    行业充电
    客户端生成web service
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199518.html
Copyright © 2020-2023  润新知