跳转至

16. 设置kibana测试慢日志收集

1. 清理elasticsearch的索引

#10.0.8.5
#1.查看
curl 127.0.0.1:9200/_cat/indices

#2.删除索引
curl -XDELETE 127.0.0.1:9200/10.0.8.5*

#3.查看
curl 127.0.0.1:9200/_cat/indices

2. 生成慢日志

mysql -uroot -p123456 -e "select * from db1.t1 where id=4888;"
root@4c16g:/tmp# mysql -uroot -p123456 -e "select * from db1.t1 where id=488;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-----+
| id  |
+-----+
| 488 |
+-----+
root@4c16g:/tmp# curl 127.0.0.1:9200/_cat/indices
green  open .geoip_databases                      vp77wdCxR6ersomYKR7XIg 1 0  44    5  40.8mb  40.8mb
yellow open 10.0.8.1-apache2-accesslog_2022.01.01 NVjpSyKHTa-mmGVJ3fbS3w 1 1 291    0 501.9kb 501.9kb
yellow open 10.0.8.4-nginx-accesslog_2021.12.31   mjvv2a2GRB-VS6zAi-R1VA 1 1  66    0 189.9kb 189.9kb
green  open .kibana_task_manager_7.16.2_001       1n0PxyQoSJKKmUs20b79qA 1 0  17 9521  11.1mb  11.1mb
green  open .apm-custom-link                      NwEzmXWMRb-Lnnw_Y8C33Q 1 0   0    0    226b    226b
green  open .kibana_7.16.2_001                    LCun_7ggQiekuppoURCj8w 1 0 408   49   2.4mb   2.4mb
green  open .apm-agent-configuration              kQzGyZJxSSaotJkeBbpVbQ 1 0   0    0    226b    226b
green  open .async-search                         9RuXcU90T1OMOX-AZ6YDZA 1 0   0    0    256b    256b
yellow open filebeat-7.16.2-2022.01.01            q8xdwWFyRzayYohqua64og 1 1  23    0 159.4kb 159.4kb   #出现这里
yellow open 10.0.8.4-nginx-accesslog_2022.01.01   LmH5-VlxRgCnEROuEH7BUA 1 1  52    0   284kb   284kb
yellow open 10.0.8.1-apache2-accesslog_2021.12.31 P07lUSMvQCy_erHOT5lW6w 1 1  88    0 228.5kb 228.5kb
green  open .tasks                                rDc3gYaqTtiYoUe7TPlBig 1 0   4    0  21.4kb  21.4kb

1. logstash输出添加自定义索引测试以下啊!!!!

3. kibana查看

#1.删除原来的索引,创建新索引

img_22.png


最后更新: 2022-02-19 13:05:46