91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

filebeat 6.4.3 采集 nginx日志

發布時間:2020-07-29 02:16:31 來源:網絡 閱讀:6484 作者:無鋒劍 欄目:大數據

filebeat 6.4.3 采集 nginx日志

nginx 日志格式規范:

將日志配置組合添加至nginx主配置文件;

     log_format  eslog  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

ES集群安裝插件

集群收集nginx日志需要安裝 ingest-user-agent ,ingest-geoip ,安裝完成之后需要重啟es 服務,否則數據無法正常錄入es集群。

/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-user-agent
/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-geoip
/usr/share/elasticsearch/bin/elasticsearch-plugin list

升級java至1.8

yum install java-1.8 -y

安裝filebeat

導入key

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

創建repo 文件

more lostash.repo

[elastic-6.x]
name=Elastic repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

安裝

yum install filebeat -y

修改filebeat主配置文件

more /etc/filebeat/filebeat.yml

filebeat.config:
prospectors:
path: ${path.config}/prospectors.d/.yml
reload.enabled: false
modules:
path: /etc/filebeat/modules.d/
.yml
reload.enabled: false

output.elasticsearch:
hosts: ['10.2.3.30:9200']

setup.kibana:
host: "10.2.3.13:5601"

配置filebeat nginx 模塊
Access 日志:/data/nginxlog/eslog/es-access.*
Error 日志:/data/nginxlog/eslog/es-error.*
more /etc/filebeat/modules.d/nginx.yml 
- module: nginx
  # Access logs
  access:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    var.paths: ["/data/nginxlog/eslog/es-access.*"]
  # Error logs
  error:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    var.paths: ["/data/nginxlog/eslog/es-error.*"]
添加啟動
systemctl enable filebeat

開啟nginx 模塊

cd /etc/filebeat

filebeat modules enable nginx

filebeat modules list
初始化環境

此操作會自動導入filebeat模板和nginx dashboard 到es 集群:

Set up the initial environment:
Loaded index template
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards
Loaded machine learning job configurations
./filebeat setup -e
啟動服務
systemctl start filebeat
啟動服務報錯

內容如下:

Exiting: Error importing Kibana dashboards: fail to import the dashboards in Kibana: Error importing directory /usr/share/filebeat/kibana: Failed to import index-pattern: Failed to load directory /usr/share/filebeat/kibana/6/index-pattern:
  error loading /usr/share/filebeat/kibana/6/index-pattern/filebeat.json: returned 400 to import file: <nil>. Response: {"statusCode":400,"error":"Bad Request","message":"Request Timeout after 30000ms"}

2018-10-31T16:35:45.659+0900    INFO    kibana/client.go:113    Kibana url: http://10.2.3.13:5601
2018-10-31T16:37:15.664+0900    ERROR   instance/beat.go:743    Exiting: Error importing Kibana dashboards: fail to import the dashboards in Kibana: Error importing directory /usr/share/filebeat/kibana: Failed to import index-pattern: Failed to load directory /usr/share/filebeat/kibana/6/index-pattern:
  error loading /usr/share/filebeat/kibana/6/index-pattern/filebeat.json: fail to execute the HTTP POST request: Post http://10.2.3.13:5601/api/kibana/dashboards/import?force=true: net/http: request canceled (Client.Timeout exceeded while awaiting headers). Response: 
處理辦法:

登陸kibana 進入Dev tools 刪除

刪除舊模板
    #DELETE _template/filebeat-6.X.X 
刪除舊數據
    #DELETE filebeat-6.4.2-*
重新導入模板:
cd /etc/filebeat/
filebeat setup
Loaded index template
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards
Loaded machine learning job configurations
重啟服務:
systemctl restart filebeat

Dashboard 效果:

filebeat 6.4.3 采集 nginx日志

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

乐山市| 宜阳县| 化德县| 韶山市| 开封县| 遂川县| 左权县| 祁阳县| 金寨县| 冕宁县| 博湖县| 汤阴县| 西林县| 共和县| 淮北市| 桂阳县| 习水县| 华蓥市| 宁明县| 天门市| 封开县| 渝北区| 老河口市| 德兴市| 岢岚县| 扎鲁特旗| 抚顺市| 阿鲁科尔沁旗| 阿巴嘎旗| 芒康县| 霞浦县| 乌兰察布市| 甘泉县| 荥经县| 集安市| 大竹县| 靖安县| 简阳市| 隆化县| 长宁县| 长春市|