Elasticsearch 简明教程

Elasticsearch - Filtering by Field

Kibana 主页中可用的发现功能使我们能够从各个角度探索数据集。你可以搜索和筛选选定索引模式的数据。数据通常以一段时间内值的分布形式存在。

The discover functionality available in Kibana home page allows us to explore the data sets from various angles. You can search and filter data for the selected index patterns. The data is usually available in form of distribution of values over a period of time.

要探索电子商务数据样本,我们会单击 Discover 图标,如下面图片所示。这将会调出数据和图表。

To explore the ecommerce data sample, we click on the Discover icon as shown in the picture below. This will bring up the data along with the chart.

discover

Filtering by Time

要按特定时间间隔筛选数据,我们会使用时间筛选选项,如下所示。默认情况下,筛选器设置为 15 分钟。

To filter out data by specific time interval we use the time filter option as shown below. By default, the filter is set at 15 minutes.

filtering by time

Filtering by Fields

还可以使用 Add Filter 选项按字段筛选数据集,如下所示。在此,我们添加一个或多个字段并在应用筛选器后获取相应的结果。在我们的示例中我们选择字段 day_of_week ,然后选择该字段的操作符为 is ,值则为 Sunday

The data set can also be filtered by fields using the Add Filter option as shown below. Here we add one or more fields and get the corresponding result after the filters are applied. In our example we choose the field day_of_week and then the operator for that field as is and value as Sunday.

filtering by fields

接下来,我们会单击使用以上筛选条件保存。应用了筛选条件的结果集如下所示。

Next, we click Save with above filter conditions. The result set containing the filter conditions applied is shown below.

edit filter conditions