前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ELK Stack最新版本测试二配置篇

ELK Stack最新版本测试二配置篇

作者头像
三杯水Plus
发布2018-11-14 16:23:10
3690
发布2018-11-14 16:23:10
举报
文章被收录于专栏:运维运维

阅读本文前请浏览

ELK Stack最新版本测试一安装篇

http://jerrymin.blog.51cto.com/3002256/1720109

详细配置如下:

一,客户端

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反向代理配置

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,创建索引

wKioL1ZyFgjxBcHOAADiQbeEHoY485.png
wKioL1ZyFgjxBcHOAADiQbeEHoY485.png

2,创建视图

wKioL1ZyFh-RaoeHAADBXkPxxcU100.png
wKioL1ZyFh-RaoeHAADBXkPxxcU100.png

3,创建面板

wKioL1ZyFjeAGK4WAAD7OimdHzA557.png
wKioL1ZyFjeAGK4WAAD7OimdHzA557.png
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015-12-06 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档