zoukankan      html  css  js  c++  java
  • Kibana 官方示例

    Kibana 官方示例

    官方网站:
    中文站点:

    环境:
    kibana-4.5
    elasticsearch-2.3.2
    测试环境为单机版,elasticsearch集群环境,请参看Elasticsearch集群


    一.下载并解压示例数据


    二.创建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              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
    1.Settings(定义Index Patterns)
    创建时不要勾选Index contains time-based events
    创建3个indices(shakes*, ba*, logstash*)
    Kibana <wbr>官方示例


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

    3.Visualize
    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>官方示例

  • 相关阅读:
    我的DBDA类文件
    登录时的验证码怎么写?
    phpcms 制作简单企业站的常用标签
    HTML 基础知识
    目标
    split函数的实现
    myString操作符重载
    cout中的执行顺序_a++和++a
    二叉树的层次遍历法
    树的前中序遍历_求后续遍历
  • 原文地址:https://www.cnblogs.com/lixuebin/p/10814095.html
Copyright © 2011-2022 走看看