• 为什么写博客,是因为遇到的坑,不希望别人在踩一遍!
  • 选择了,剩下的就是坚持和努力-------致自己!
  • 当能力达不到梦想时,更需要学习,努力,拼搏

ELK5系列日志收集平台(九)kibana使用指南

ELK 雪豹 6年前 (2018-02-11) 683次浏览 0个评论

images

第1章 Kibana 日志查看

1.1 打开浏览器

打开浏览器,输入 http://172.16.1.20:5601

images

提示:进入kibana主页面,没有内容

1.1 在左上角选择自己需要查看的日志

images

1.2 请选择右上角选择时间

images

因为默认是,15分钟内的日志,点击Last 15 minutes 后,可根据自己的需求,在此选择时间

images

images

 

第2章 Kibana 搜索一个错误

在搜索栏 查看 error

images

2.1 查看日志技巧

在Popular 下面的列表中可以选择日志含有的类型,添加到右边的日志列表中

images

选择日志的类型 点击remove 就是删除

images

第1章 Kibana 设置Tile Map 高德地图设置

1.1 安装logstash的geoip插件

使logstash可以获取到国家及城市信息

 [root@elk2 tools]# /usr/share/logstash/bin/logstash-plugin install logstash-filter-geoip  
#提示:安装过程有点慢等待会。
Validating logstash-filter-geoip
Installing logstash-filter-geoip
which: no javac in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
Installation successful
 [root@elk2 tools]#  yum install GeoIP-data –y

3.2 编辑kibana配置文件

# 在 kibana.yml,最后面添加
[root@elk2 tools]# vim /etc/kibana/kibana.yml
tilemap.url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}'

3.3 添加后重启kibana

[root@elk2 bundles]# /etc/init.d/kibana restart

3.4 在logstash服务器下载IP地址归类查询库

# 进入到下载目录
[root@elk2 tools]# cd /home/yunwei/tools/
# 下载 解压
[root@elk2 tools]# wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz 
[root@localhost ~]# gunzip GeoLite2-City.mmdb.gz
现在弄得
[root@elk2 conf.d]# cat nginx.conf 
input {
    redis {
    type => "nginx20_access"
    host => "172.16.1.21"
    data_type => "list"
    key => "nginx20_access"
    }
}
filter {
        if [type] == "nginx20_access" {
                geoip {
                        source => "clientip"
                        target => "geoip"
                        database => "/etc/logstash/GeoLite2-City.mmdb"
                        add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
                        add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}"  ]
                }
                mutate {
                        convert => [ "[geoip][coordinates]", "float"]
                }
        }
}
output {
  if [type] == "nginx20_access"{
    elasticsearch {
    hosts => "172.16.1.20:9200"
  index => "logstash-nginx20_access-%{+YYYY.MM.dd}"
  }
 }
}

images

images

1.1 进入后选择Geo Coordinates

images

1.1 查看地图中有访问的IP

images

1.1 在Options 中可以选择不同的标识IP 方式

 

images

1.1 绘制kibana 地图 热度图

images

 


有需要可以联系微信xuebao19930721和加入微信群
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址