1 下载json数据包 使用kibana完成数据分析 官网数据文档地址
https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html
2 下载官网上的数据包(下载的是第一个也可以下载第二个)
wget https://download.elastic.co/demos/kibana/gettingstarted/shakespeare_6.0.json
3 模拟数据 将下载完成的数据包 导入到elasticSearch 在通过kibana读取指定索引库的数据完成报表分析(导入数据模拟的是logstash采集数据的过程)官网提供的将数据包导入elasticsearch的命令(这里使用第二条导入shakespeare.json)
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/_bulk?pretty' --data-binary @logs.jsonl
4 导数据之前先开启elasticsearch 如果出现jvm内存溢出 则去修改那个jvm.options中xms
-Xms248m
-Xmx248m
curl -H 'Content-Type: application/x-ndjson' -XPOST '192.168.34.3:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json
5 启动kibana 从elasticsearch中读取数据进入kibana的web页面可以看到刚导入的数据已经已自动创建索引库shakespeare
6 根据官方文档执行下来对 line_id进行分析生成如下报表