1、查看Graylog日志索引列表信息
curl -s -XGET "http://localhost:9200/_cat/indices?v&s=index"
可以查看各索引的大小
2、如何使用脚本快速清理索引释放磁盘空间
清理脚本delete_index.sh
如下
#!/bin/bashindex=$1start=$2end=$3for ((i=start; i<=end; i++))do curl -XDELETE "http://localhost:9200/${index}_${i}"done
当然你也可以在Indices中手工去删除指定的旧索引
3、未活跃的Sidecar清理时间间隔
Amount of time after which inactive Sidecars are purged from the database.
例如调整为PT30M,即30分钟自动清理不活跃的Sidecar Agent
4、Search查询语法中前置通配符问题
默认Graylog未开启前置通配符,如果要开启的话,需要在配置文件中手动开启,并重启服务生效 具体方法
vim /etc/graylog/server/server.conf 将allow_leading_wildcard_searches = false修改为allow_leading_wildcard_searches = true然后 systemctl restart graylog-server.service
这样就可以支持前置通配符的查询,例如 *name
5、超过索引中总字段 [1000] 的限制
Limit of total fields [1000] has been exceeded
/var/log/graylog-server/server.log 中有如下报错
index [bastion_0], id [051d2151-bd3b-11ef-984c-005056b6bf7a], message [OpenSearchException[OpenSearch exception [type=illegal_argument_exception, reason=Limit of total fields [1000] has been exceeded]]]
解决办法
curl -v -XPUT http://127.0.0.1:9200/indexnameXXX_0/_settings -H 'Content-Type: application/json' -u admin:Opensearch_2024 -d '{"index.mapping.total_fields.limit": 2000 }'
6、PrometheusAlert钉钉告警模板中实现一键联系管理员
解决办法:
https://open.dingtalk.com/document/orgapp/applink-open-personal-details-page
PrometheusAlert钉钉告警模板中的语法
##### <font color=#FF0000>联系管理员张三</font>:👉[点此联系](https://applink.dingtalk.com/page/profile?phone=185XXXX2514)
7、gl2_remote_ip日志源IP字段
例如Linux服务器日志在All Messages中只能看到source字段显示,看不到该Linux服务器的IP 其实可以用gl2_remote_ip日志源字段来解决
8、一键脚本完装完Graylog后mongodb服务无法启动
Graylog服务器后台SSH可以dmesg -T
看到如下报错
mongod[XXXX] trap incalid opcode ...
原因:CPU 不支持AVX指令集
https://blog.csdn.net/JINXFOREVER/article/details/127262382
然而mongodb 5.0以上版本需要CPU支持AVX指令集,官方文档如下
https://www.mongodb.com/zh-cn/docs/manual/administration/production-notes/
VMware虚拟化CPU 不支持AVX指令集解决办法:
https://blog.csdn.net/hzgnet2021/article/details/134925349
原文始发于微信公众号(WalkingCloud):GrayLog常见问题收录-FAQ篇
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论