ELK Stack最新版本測試二配置篇_PHP教程

來源:互聯網
上載者:User

ELK Stack最新版本測試二配置篇


閱讀本文前請瀏覽
詳細配置如下:
http://blog.chinaunix.net/uid-25057421-id-5567766.html
一,用戶端
1,nginx日誌格式
log_format logstash_json '{ "@timestamp": "$time_iso8601", '
'"host": "$server_addr", '
'"clientip": "$remote_addr", '
'"size": $body_bytes_sent, '
'"responsetime": $request_time, '
'"upstreamtime": "$upstream_response_time", '
'"upstreamhost": "$upstream_addr", '
'"http_host": "$host", '
'"url": "$uri", '
'"referrer": "$http_referer", '
'"xff": "$http_x_forwarded_for", '
'"agent": "$http_user_agent", '
'"status": "$status"} ';
access_log /data/wwwlogs/access_jerrymin.test.com.log logstash_json;
2,fielbeat設定檔
filebeat:
prospectors:
-
- /data/wwwlogs/access_jerrymin.test.com.log


doucmenttype:jerrymin.test.com
output:
logstash:
enabled: true
hosts: ["192.168.0.58:5044"]
shipper:
3,topbeat設定檔
input:
# In seconds, defines how often to read server statistics
period: 10


# Regular expression to match the processes that are monitored
# By default, all the processes are monitored
procs: [".*"]


# Statistics to collect (all enabled by default)
stats:
system: true
proc: true
filesystem: true
output:


### Elasticsearch as output
elasticsearch:
hosts: ["192.168.0.58:9200"]
shipper:
logging:
files:
rotateeverybytes: 10485760 # = 10MB
二,服務端配置
1,logstash設定檔
[root@localhost logstash]# cat /etc/logstash/conf.d/nginxconf.json
input {
beats {
port => 5044
codec => json
}
}


filter {
mutate {
split => [ "upstreamtime", "," ]
}
mutate {
convert => [ "upstreamtime", "float" ]
}
}


output {
elasticsearch {
hosts => "192.168.0.58:9200"
sniffing => true
manage_template => false
# index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
index => "filebeat-%{type}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
}
2,elasticsearch設定檔
[root@localhost logstash]# cat /etc/elasticsearch/elasticsearch.yml |grep -Ev "^#|^$"
path.data: /data
path.logs: /data/elklogs
network.host: 192.168.0.58
http.port: 9200
3,kibana設定檔
[root@localhost config]# cat /var/kibana/config/kibana.yml
# Kibana is served by a back end server. This controls which port to use.
server.port: 5601


# The host to bind the server to.
server.host: "0.0.0.0"


# The Elasticsearch instance to use for all your queries.
elasticsearch.url: "http://192.168.0.58:9200"
三,Tengine反向 Proxy配置
cat /usr/local/nginx/conf/vhosts_all/kibana.conf
server
{
listen 8888;
server_name 192.168.0.58
index index.html index.shtml;

location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
auth_basic "Please input Username and Password";
auth_basic_user_file /usr/local/nginx/conf/.pass_file;
}


access_log /data/wwwlogs/access.kibana.log access;
}
四,登陸平台
http://192.168.0.58:8888
1,建立索引


2,建立視圖


3,建立面板

http://www.bkjia.com/PHPjc/1081463.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1081463.htmlTechArticleELK Stack最新版本測試二配置篇 閱讀本文前請瀏覽 詳細配置如下: http://blog.chinaunix.net/uid-25057421-id-5567766.html 一,用戶端 1,nginx日誌格式...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.