Kibana 官方示例

备份:https://yunpan.cn/cPz4uxZhJeJdv (提取码:4667)

官方网站:

https://www.elastic.co/guide/en/kibana/current/getting-started.html

中文站点:

http://kibana.logstash.es/content/kibana/v4/setup.html

环境:

kibana-4.5

elasticsearch-2.3.2

测试环境为单机版,elasticsearch集群环境,请参看Elasticsearch集群

一.下载并解压示例数据

wget https://www.elastic.co/guide/en/kibana/3.0/snippets/shakespeare.json

wget https://github.com/bly2k/files/blob/master/accounts.zip?raw=true

wget https://download.elastic.co/demos/kibana/gettingstarted/logs.jsonl.gz

二.创建mapping

Use the following command to set up a mapping for the Shakespeare data set:

curl -XPUT http://localhost:9200/shakespeare -d '{
 "mappings" : {
  "_default_" : {
   "properties" : {
    "speaker" : {"type": "string", "index" : "not_analyzed" },
    "play_name" : {"type": "string", "index" : "not_analyzed" },
    "line_id" : { "type" : "integer" },
    "speech_number" : { "type" : "integer" }
   }
  }
 }}';


Use the following commands to establish geo_point mapping for the logs:

curl -XPUT http://localhost:9200/logstash-2015.05.18 -d '{
  "mappings": {
    "log": {
      "properties": {
        "geo": {
          "properties": {
            "coordinates": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }}';

curl -XPUT http://localhost:9200/logstash-2015.05.19 -d '{
  "mappings": {
    "log": {
      "properties": {
        "geo": {
          "properties": {
            "coordinates": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }}';

curl -XPUT http://localhost:9200/logstash-2015.05.20 -d '{
  "mappings": {
    "log": {
      "properties": {
        "geo": {
          "properties": {
            "coordinates": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }}';


三.导入示例数据--莎士比亚全集

curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json
curl -XPOST 'localhost:9200/shakespeare/_bulk?pretty' --data-binary @shakespeare.json
curl -XPOST 'localhost:9200/_bulk?pretty' --data-binary @logs.jsonl

root@jlive:~#curl 'localhost:9200/_cat/indices?v'

health status index               pri rep docs.count docs.deleted store.size pri.store.size 

yellow open   shakespeare           5   1     111396            0       18mb          18mb 

yellow open   logstash-2015.05.20   5   1       4750            0     27.5mb         27.5mb 

yellow open   bank                  5   1       1000            0    442.6kb       442.6kb 

yellow open   logstash-2015.05.18   5   1       4631            0     29.2mb         29.2mb 

yellow open   logstash-2015.05.19   5   1       4624            0     30.3mb         30.3mb 



四.kibana Dashboard

https://www.elastic.co/guide/en/kibana/current/tutorial-define-index.html

1.Settings(定义Index Patterns)

http://kibana.logstash.es/content/kibana/v4/settings.html

创建时不要勾选Index contains time-based events

创建3个indices(shakes*, ba*, logstash*)

Kibana <wbr>官方示例


2.Discover

Kibana <wbr>官方示例
account_number:<100 AND balance:>47500

3.Visualize

https://www.elastic.co/guide/en/kibana/current/tutorial-visualizing.html

i.Pie Chart

Pie Chart --> From a new search --> ba* --> Split Slices --> Range --> balance --> Add Range

Kibana <wbr>官方示例


Add sub-buckets --> Split Slices --> Terms --> age --> Apply changes --> Save Visualization(Pie-Example)

Kibana <wbr>官方示例
ii.Vertical bar chart

New Visualization --> Vertical bar chart --> From a new search --> shakes*

Y-axis --> Unique Count --> speaker

X-Axis --> Terms --> play_name --> Order --> Ascending --> Size(5)


Y-axis --> Add metrics --> Max --> speech_number 

Options --> Bar Mode --> grouped --> Apply changes --> Save Visualization(Bar-Example)

Kibana <wbr>官方示例

iii.Tile map

Dashboard --> Absolute(May 18, 2015  to May 20, 2015) --> Go

Kibana <wbr>官方示例

Tile map --> From a new search --> logstash* --> Geo Coordinates --> Geohash --> geo.coordinates  --> Apply changes --> Save Visualization(Map-Example)

Kibana <wbr>官方示例

Kibana <wbr>官方示例

可以拖拽,放大缩小,改变地图样式,自定义过滤条件

iv.Markdown widget

# This is a tutorial dashboard!The Markdown widget uses **markdown** syntax.> Blockquotes in Markdown use the > character.

 

Click the green Apply changes button images/apply-changes-button.png to display the rendered Markdown in the preview pane:

Kibana <wbr>官方示例

保存为Markdown Example

4.整合Visualize到Dashboard

Dashboard --> Add Visualization --> Markdown ExamplePie ExampleBar Example, and Map Example --> Save Dashboard(Tutorial Dashboard)

Kibana <wbr>官方示例

Kibana <wbr>官方示例


转载于:https://my.oschina.net/clgo/blog/671861

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值