Kibana 简明教程

Kibana - Dev Tools

我们可以使用 Dev Tools 在 Elasticsearch 中上传数据,而无需使用 Logstash。我们可以发布、放入、删除、搜索我们在 Kibana 中使用 Dev Tools 想要的数据。

We can use Dev Tools to upload data in Elasticsearch, without using Logstash. We can post, put, delete, search the data we want in Kibana using Dev Tools.

若要创建 Kibana 中的新索引,我们可以在 dev 工具中使用以下命令 -

To create new index in Kibana we can use following command in dev tools −

Create Index USING PUT

创建索引的命令如下所示 -

The command to create index is as shown here −

PUT /usersdata?pretty

执行此命令后,将创建一个空索引用户数据。

Once you execute this, an empty index userdata is created.

create index using put

已完成索引创建。现在将添加索引中的数据 -

We are done with the index creation. Now will add the data in the index −

Add Data to Index Using PUT

您可以如下向索引中添加数据 -

You can add data to an index as follows −

add data using put
add data index

我们将向用户数据索引中添加一个记录 -

We will add one more record in usersdata index −

usersdata index

因此,我们在用户数据索引中有 2 个记录。

So we have 2 records in usersdata index.

Fetch Data from Index Using GET

我们可以如下获得记录 1 的详细信息 -

We can get the details of record 1 as follows −

index using get

您可以如下获得所有记录 -

You can get all records as follows −

get all records

所以,我们可以像上面所示获得来自 usersdata 的所有记录。

Thus, we can get all the records from usersdata as shown above.

Update data in Index using PUT

要更新记录,您可以执行以下操作:

To update the record, you can do as follows −

update index using put

我们将名称从“Ervin Howell”更改为“Clementine Bauch”。现在,我们可以从索引获取所有记录并如下所示查看更新的记录:

We have changed the name from “Ervin Howell” to “Clementine Bauch”. Now we can get all records from the index and see the updated record as follows −

update record

Delete data from index using DELETE

您可以如下所示删除记录:

You can delete the record as shown here −

index using delete

现在,如果您查看总记录,我们将只看到一条记录:

Now if you see the total records we will have only one record −

我们可以如下所示删除创建的索引:

We can delete the index created as follows −

index using deleted
delete index created

现在,如果你检查可用的索引,我们将不会在其中找到 usersdata 索引,因为已经删除了索引。

Now if you check the indices available we will not have usersdata index in it as deleted the index.