医生猎人 发表于 2015-11-27 12:58:55

Kibana 10 分钟入门

  


10 分钟入门


  
  Kibana 是一个分析搜索实时数据的非常强大的工具,仅仅通过这个页面的介绍,你就可以充分的认识并使用Kibana了。 Download
Kibana
  到此简介的最后,你将学会如何导入数据,尝试使用一些简单的仪表盘,搜索你的数据,配置你的Kibana使它仅指向你新创建的索引,而不是所有的索引片。我们假定你已经安装并配置好了elasticsearch,以及拥有一个web服务器,熟悉基本的UNIX/Linux 操作, 会使用 curl 这个工具。
  


import some data 导入一些数据

我们将使用莎士比亚的全部文集作为我们的示例数据。为了充分的使用Kibana,你需要对数据进行索引,让我们创建一个名为shakespeare的索引,现不用管以下的命令是什么含义:

  
  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" }
}
}
}
}
';太好了,我们已经创建了索引。现在,我们要导入数据。您在这里下载莎士比亚整个作品的数据:shakespeare.json

导入此数据使用如下命令:
  <span style=&quot;font-size:14px;&quot;>curl -XPUT localhost:9200/_bulk --data-binary @shakespeare.json</span>


accessing the kibana interface 访问Kibana的界面

打开浏览器,指向到你的kibana安装的位置,你会看到如下界面:
http://www.elasticsearch.org/guide/en/kibana/current/tutorials/intro/intro.png





点击 Sample Dashboard,会出现下面的界面:  
  http://www.elasticsearch.org/guide/en/kibana/current/tutorials/intro/sample_shakespeare.png


  现在你可以看到你的简单的仪表盘,你会发现,有一个饼状图以及在仪表盘的下面,有一行一行的JSON格式的数据。
  the first search 第一次搜索
  Kibana允许你通过Lucene查询语法来搜索elasticsearch的数据。
http://www.elasticsearch.org/guide/en/kibana/current/tutorials/intro/query.png


  


  在查询栏中输入这个。然后检查了表的前几行:


  <span style=&quot;font-size:14px;&quot;>friends, romans, countrymen</span>

http://www.elasticsearch.org/guide/en/kibana/current/tutorials/intro/firsttable.png


  


configuring another index 配置令一个索引

要配置kibana指向的索引按一下右上方的配置图标:

http://www.elasticsearch.org/guide/en/kibana/current/tutorials/intro/configicon.png





在这里,你可以设置你的索引指向shakespeare和确保Kibana只搜索shakespeare索引:

http://www.elasticsearch.org/guide/en/kibana/current/tutorials/intro/indexconfigure.png



  
页: [1]
查看完整版本: Kibana 10 分钟入门