BTW i want to share my solution to you:
I've added this to winlogbeat:
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
- drop_fields:
fields: [winlog.event_data.ElevatedToken, winlog.event_data.ImpersonationLevel, winlog.event_data.KeyLength, winlog.event_data.LmPackageName, winlog.event_data.LogonGuid, winlog.event_data.RestrictedAdminMode, winlog.event_data.TargetLinkedLogonId, winlog.provider_guid, winlog.process.pid, winlog.event_data.TargetLogonId, winlog.event_data.TargetOutboundDomainName, winlog.event_data.TargetOutboundUserName, winlog.event_data.TargetUserSid, winlog.event_data.TransmittedServices, winlog.event_data.VirtualAccount, winlog.keywords, winlog.opcode, winlog.provider_name, winlog.record_id, winlog.process.thread.id, winlog.version]
and this to filter in logstash:
# Domain Controllers logs filtering
if "windc" in [tags] and [event][code] == 4776 and [winlog][event_data][Status] == "0x0" {
drop {}
}
if "windc" in [tags] and [event][code] == 4776 {
prune {
remove_field => ["[agent][id]","[agent][ephemeral_id]","[agent][hostname]","[agent][type]","[agent][version]","[ecs][version]","[event][kind]","[host][architecture]","[host][hostname]","[host][os][build]","[host][os][family]","[host][os][kernel]","[host][os][platform]","[host][os][version]"]
blacklist_names => ["^.*winlog.*"]
}
}
# Domain Controllers logon events
if "windc" in [tags] and [event][code] == 4624 and [winlog][event_data][TargetUserName] == "admin1 or [winlog][event_data][TargetUserName] == "admin2" {
drop {}
}
if "windc" in [tags] and [event][code] == 4624 {
prune {
remove_field => ["[agent][id]","[agent][ephemeral_id]","[agent][hostname]","[agent][type]","[agent][version]","[ecs][version]","[event][kind]","[host][architecture]","[host][hostname]","[host][os][build]","[host][os][family]","[host][os][kernel]","[host][os][platform]","[host][os][version]"]
blacklist_names => ["message"]
}
}
Some field, which we never need, could be deleted via ingest pipeline:
"remove-fields" : {
"description" : "remove a exchange of fields",
"processors" : [
{
"remove" : {
"field" : [
"agent.ephemeral_id",
"agent.hostname",
"agent.id",
"agent.type",
"agent.version",
"ecs.version",
"input.type",
"log.offset",
"log.file.path",
"version"
],
"ignore_failure" : true
}
}
]
}
It looks bulky, a bit, but works ok. Some filtering in logstash could be done via whitelist, but I couldn't make it work.