Page 1 of 1

NLS delete all ogs if progarm name is incorrect

Posted: Sat Dec 12, 2020 4:19 am
by msawant007
On one NLS server I executed below command which normally use to delete logs of specific program. Mistakenly I had input wrong program name and command deleted logs of all applications/programs from NLS server. When I executed command output shown "successfully deleted logs" but it should return "program name is incorrect". Please suggest any solution for this to avoid such mistake in future? Any other alternative safe command available to delete logs?
Command I executed - curl -X DELETE -d '{"query": {"match": {"program": "prod-web-api02"}}}' http://localhost:9200/logstash-2020.12.07/_query;
Actual program name - prod-web-api02-default-logs