JCS for Elasticsearch


JCS for Elasticsearch

Documentation > Products > JCS for Elasticsearch > Build a Visual Analysis System with kibana

Build a Visual Analysis System with kibana

Kibana is a visual open source platform for data analysis. Users can use Kibana to search and analyze the data stored in JCS for Elasticsearch. 查询1

Stored Data

Definition Index mapping

Enter into the ES Console, single-click kibana in the Instance List page to be redirected to kibana web page, and click Dev Tools in the left navigation bar to enter the page where data can be stored. Index name is blog_index, type name is user, the types of field title and name are text, and the type of field age is integer. Then index pattern can be added through Management->Index Patterns. 查询1

PUT blog_index

"mappings": {

"user": {

"properties": {

"title": { "type": "text" },

"name": { "type": "text" },

"age": { "type": "integer" }


# Add the index document
PUT blog_index/user

"title": "manager",

"name": "Tom Jerry",

"age": 34


Definition Index Mode

Single click Management in the left navigation bar, and select Index Patterns, so you can define the new index mode in the page.

Operation Example

  1. Define index "shakes*" for the sample data set Shakespeare in the previous step, then click Create.

  2. Define another index "ba*" with the same method;

  3. Click Add New to define indexes for the sample data set logstash in the previous step, check Use event times to create index names [DEPRECATED] and select Daily in the drop-down box Index pattern interval.

  4. Select @timestamp in the drop-down box Time Filter field name, and click Create to complete the definition of index.

Retrieve Data

Single click Discover in the left navigation bar of kibana, and select the corresponding index to view the search results. Retrieval may also be done in the search box by entering specific search conditions, and in the search box it is allowed to use operational character >,<=, logic symbol "AND OR NOT"(Uppercase) for combine search.

Operation Example

  1. Select "ba*" as the retrieval conditions;

  2. Enter "account_number:<100 AND balance:>47500" in the search box for search;

  3. Under the search conditions, results with the account_number between [0, 99] and the balance value more than 47,500 will be returned.

查询1 In addition, the search results may be filtered by adding filter attributes as conditions. Select Add as the Fields in the filter conditions under Available Fields list. If account_number is selected as the Fields, then the search result only contains the account_number column. 查询1

Data Visualization

Single click Visualize in the left navigation bar of kibana for data visualization.

Operation Example

  1. Click Create a visualization in the center of the screen;

查询1 2. Select pie.

查询1 3. Select the index mode as "ba*" for data visualization. Visualization may be created in the search results already saved, and new retrieval rules may be also entered again. If retrieval rules are entered again, a retrieval mode is required to be specified;

查询1 4. All documents are searched and matched by default.

查询1 5. Define bucket. In the sample data set account.json, each account includes balance. Create a bucket to define the ranges of balance, and view how many accounts there are in each rangs.

a) Click Split Slices bucket type

b) Select Range in the drop-down box of Aggregation

c) Select balance in the drop-down box of Field

d) Click Add Range for 4 times, and there are totally 6 rangs

e) Define the following ranges:

0 999

1000 2999

3000 6999

7000 14999

15000 30999

31000 50000

Thus, the proportion of account in each balance range can be seen. 查询1 6. Define sub-bucket: Use the holder’s age of the account as the measurement unit, add another bucket, and the age of account holder in each balance range can be seen.

a) Click Add sub-buckets bucket type

b) Click Fields Split Slices bucket type

c) Select Terms in the drop-down box of sub Aggregation

d) Select age in the drop-down box of Field

e) Click Apply changes

Now it can be seen that the age of account holder encircles in the balance range.

查询1 7. Click Save and enter "Pie Example" for saving.

Any other type of visualization may be created based on your needs, such as Coordinate Map, Markdown, and Vertical Bar.

Combine the dashboard

Click Dashboard in the left navigation bar of kibana page, click Add to display all the saved visual charts, click the saved visual data, and click the small up arrow to consolidate the visual lists Then, saving and generating link share will be available.

Update Time:2019-11-25 19:49:14