• 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配置对了,自动建索引


  • 相关阅读:
    清除ListBox的列表项(删除所有项目)
    创建对象
    搜索功能
    为下拉式菜单(DropDownList)添加第一个选项
    事件接口
    用户控件(UserControl) 使用事件 Ver2
    MS SQL动态创建临时表
    炒粉还是煮面
    输入数字动态创建行
    DataList中TextBox onfocus调用后台静态方法
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199517.html
Copyright © 2020-2023  润新知