NLS delete all ogs if progarm name is incorrect

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
msawant007
Posts: 2
Joined: Sat Dec 12, 2020 3:38 am

NLS delete all ogs if progarm name is incorrect

Post 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
Locked