deleting specific log events

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
newmember
Posts: 43
Joined: Sat Sep 03, 2016 2:54 pm

deleting specific log events

Post by newmember »

Would this be correct syntax to delete all SourceName fields that contain "Microsoft-Windows-Security-Auditing"?
The Query in the GUI looks to be a good filter.
24hrs has = 262300014 hits

Code: Select all

curl -XDELETE 'http://localhost:9200/logstash-*/_query?q=SourceName="Microsoft-Windows-Security-Auditing"'

Cheers
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: deleting specific log events

Post by scottwilkerson »

Deleting by query isn't natively available in this verison of ES

You have to add it via plugin
https://www.elastic.co/guide/en/elastic ... query.html

Code: Select all

cd /usr/local/nagioslogserver/elasticsearch/
sudo bin/plugin --install delete-by-query -u https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/delete-by-query/2.4.6/delete-by-query-2.4.6.zip
systemctl restart elasticsearch
then your query should work.

******NOTE******, this obviously is a destructive query, make sure you have a backup of all pertinent data before running in-case something goes wrong.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked