Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加删除审计日志接口 #5603

Closed
wjyfelen opened this issue Aug 24, 2021 · 0 comments
Closed

增加删除审计日志接口 #5603

wjyfelen opened this issue Aug 24, 2021 · 0 comments

Comments

@wjyfelen
Copy link
Contributor

wjyfelen commented Aug 24, 2021

问题描述

当审计日志过多的时候,拉取日志的性能会下降,需要手动备份较早的审计日志后,清理日志。
请求的输入格式为{"beforeDay":"2021-08-19"},其中参数‘2021-08-19’指的是需要清理掉此日期之前的日志

示例如下:
curl -d '{"beforeDay":"2021-08-19"}' -X POST -H 'Content-Type:application/json' -H 'BK_USER:migrate' -H 'HTTP_BLUEKING_SUPPLIER_ID:0' http://127.0.01:60002/migrate/v3/delete/auditlog
注意:
1、此操作属于高危操作,在清理日志之前需要确定清理的可行性,如果需要必须事先备份好审计日志,防止误操作之后日志丢失。
2、删除操作属于cpu和磁盘io密集型操作,为了防止此操作造成cpu或者磁盘io过高,实现上做了处理,根据测试如果删除100万数据,需要的时间大概10分钟。
3、建议此操作在业务低峰期进行操作。并且日志量过大,分时间段进行操作。您想删除半年之前数据,可以分别指定删除3年前数据、2年前数据、1年前数据、半年前数据。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant