zoukankan      html  css  js  c++  java
  • 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配置对了,自动建索引


  • 相关阅读:
    HelloWorld
    CSS盒子模型
    CSS选择器
    Win右键管理员权限的获取
    本地存储
    python模块以及导入出现ImportError: No module named 'xxx'问题
    python pexpect 学习与探索
    VI查找与替换
    python 中__name__ = '__main__' 的作用
    python 脚本传递参数
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350485.html
Copyright © 2011-2022 走看看