欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

如何使用Elastic+logstash+filebeat做Nginx日志分析

這篇文章將為大家詳細(xì)講解有關(guān)如何使用Elastic+logstash+filebeat做Nginx日志分析,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

鯉城ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書合作)期待與您的合作!

一、Elasticserach安裝
1、Installation(elastic 6.3.2 版本 依賴 java  JDK8)

下載合適的版本:
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.tar.gz
tar -xvf elasticsearch-6.4.0.tar.gz
cd elasticsearch-6.4.0/bin
./elasticsearch

2、集群健康檢查
curl  -XGET  http://127.0.0.1:9200/_cat/health?v  集群健康查看
curl  -XGET  http://127.0.0.1:9200/_cat/nodes?v   節(jié)點(diǎn)狀態(tài)查看
curl  -XGET  http://127.0.0.1:9200/_cat/indices?v  查看索引
curl  -XPUT  http://127.0.0.1:9200/customer?pretty  添加customer索引
curl  -XDELETE  http://127.0.0.1:9200/customer?pretty  刪除索引

3、Config
cluster.name:  集群名
node.name:   節(jié)點(diǎn)名
path.data:   數(shù)據(jù)存儲(chǔ)路徑
path.logs:  日志存儲(chǔ)路徑
network.host:  監(jiān)聽地址
http.port:  監(jiān)聽端口
JVM  配置、logging配置  參考官方文檔
重要參數(shù):

Path settings
Cluster name
Node name
Network host
Discovery settings
Heap size
Heap dump path
GC logging
Temp directory
重要的系統(tǒng)參數(shù):

Disable swapping
Increase file descriptors
Ensure sufficient virtual memory
Ensure sufficient threads
JVM DNS cache settings

4、Running as daemon
./bin/elasticsearch -d -p pid   啟動(dòng)
kill cat pid   停止

5、Set up  X-Pack
參考x-pack破解方法

二、kibana安裝及配置

        wget https://artifacts.elastic.co/downloads/kibana/kibana-6.4.0-linux-x86_64.tar.gz

tar -xzf kibana-6.4.0-linux-x86_64.tar.gz
cd kibana-6.4.0-linux-x86_64/

        1、啟動(dòng)  ./bin/kibana   

        2、config:

server.port: 5601
server.host: "192.168.12.81"
kibana.index: ".kibana"
elasticsearch.username: "elastic"
elasticsearch.password: "dinpay"

三、logstash安裝及配置
wget  https://artifacts.elastic.co/downloads/logstash/logstash-6.4.0.tar.gz

配置 filebeat 收集Nginx日志: (Nginx.conf)

input {
beats {
port => 5044    
codec => "json"    
}                
}

output {                
elasticsearch {                
hosts => ["127.0.0.1:9200"]                
index => "test1-nginx-access-%{+YYYY.MM.dd}"                
template_overwrite => true              
user => elastic
password => dinpay      
}          
}

配置logstash.yml  elastic安裝在本機(jī)(沒有配置https)

xpack.monitoring.enabled: true  
xpack.monitoring.elasticsearch.username: elastic    
xpack.monitoring.elasticsearch.password: dinpay
xpack.monitoring.elasticsearch.url: ["http://127.0.0.1:9200"]

四、filebeat安裝及配置

wget https://artifacts.elastic.co/downloads/beats/filebeat/https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.4.0-linux-x86_64.tar.gz

tar -xf  filebeat-6.4.0-linux-x86_64.tar.gz

cd filebeat-6.4.0-linux-x86_64

配置 filebeat.yml

  • type:  log
    paths:

    • /var/log/nginx/access.log

output.logstash:

hosts: ["192.168.12.81:5044"]

xpack.monitoring:
enabled: true
elasticsearch:    
hosts: ["http://192.168.12.81:9200", "http://192.168.12.81:9200"]
username: elastic
password: dinpay

五、Nginx 日志格式配置:

log_format json '{"@timestamp":"$time_iso8601",'            
'"host":"$server_addr",'
'"clientip":"$clientRealIp",'
'"remote_user":"$remote_user",'
'"request":"$request",'      
'"http_user_agent":"$http_user_agent",'
'"size":$body_bytes_sent,'    
'"responsetime":$request_time,'
'"upstreamtime":"$upstream_response_time",'  
'"upstreamhost":"$upstream_addr",'
'"http_host":"$host",'
'"url":"$uri",'
'"domain":"$host",'
'"xff":"$http_x_forwarded_for",'
'"referer":"$http_referer",'  
'"status":"$status",'
'"ss":"$upstream_status"}';

access_log  /var/log/nginx/access.log  json;

map $http_x_forwarded_for $clientRealIp {

""  $remote_addr;

~^(?P<firstAddr>[0-9\.]+),?.*$    $firstAddr;

}

關(guān)于“如何使用Elastic+logstash+filebeat做Nginx日志分析”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。

當(dāng)前名稱:如何使用Elastic+logstash+filebeat做Nginx日志分析
文章起源:http://chinadenli.net/article38/ppcosp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)、Google、動(dòng)態(tài)網(wǎng)站、網(wǎng)站內(nèi)鏈、軟件開發(fā)、外貿(mào)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)
国产免费黄片一区二区| 亚洲中文字幕亲近伦片| 久久精品亚洲欧美日韩| 亚洲精品美女三级完整版视频| 麻豆视传媒短视频在线看| 五月婷婷综合激情啪啪| 国产精品一区二区视频成人| 日韩精品少妇人妻一区二区| 人妻精品一区二区三区视频免精| 亚洲最新的黄色录像在线| 亚洲国产丝袜一区二区三区四| 日本一区二区三区黄色| 国产专区亚洲专区久久| 99热在线精品视频观看| 日韩中文字幕人妻精品| 精品欧美在线观看国产| 国产又大又猛又粗又长又爽| 成人午夜激情免费在线| 亚洲综合日韩精品欧美综合区| 噜噜中文字幕一区二区| 无套内射美女视频免费在线观看| 午夜资源在线观看免费高清| 久久久精品区二区三区| 欧美日韩高清不卡在线播放| 亚洲欧美日韩在线中文字幕| 99久久精品午夜一区二| 99久久免费中文字幕| 婷婷亚洲综合五月天麻豆| 在线免费看国产精品黄片| 亚洲视频一区自拍偷拍另类| 日本三区不卡高清更新二区| 国内自拍偷拍福利视频| 日韩欧美国产精品中文字幕| 美女被后入视频在线观看| 成人免费在线视频大香蕉| 国产亚洲精品一二三区| 东京热男人的天堂社区| 好吊日在线观看免费视频| 大胆裸体写真一区二区| 日韩一区二区三区高清在| 色婷婷国产精品视频一区二区保健 |