Hello! I have filebeat running in kubernetes with audtid module as such:
Loading and configuring auditd module
filebeat.modules:
- module: auditd
log:
enabled: true
var.paths: ["/var/log/audit/audit.log*"]
However the filebeat pod is constantly logging this warning, and it looks like audit logs are not being properly parsed. How can I fix this?
Error Message
WARN [elasticsearch] elasticsearch/client.go:408 Cannot index event publisher.Event{Content:beat.Event{Timestamp:time.Time{wall:0xc00062d41b517c67, ext:40117709164, loc:(*time.Location)(0x60807a0)}, Meta:{"pipeline":"filebeat-7.9.3-auditd-log-pipeline"}, Fields:{"agent":{"ephemeral_id":"d34786a7-ac0c-4472-8183-91cf50148272","hostname":"ip-x-x-x-x.x-x-1.compute.internal","id":"64c35ba3-62ce-4d48-a486-700dad774694","name":"ip-x-x-x-x.x-x-1.compute.internal","type":"filebeat","version":"7.9.3"},"apiVersion":"audit.k8s.io/v1","auditID":"74cfb2e9-9ab7-4716-9c1b-90e8c9da19ba","ecs":{"version":"1.5.0"},"event":{"dataset":"auditd.log","module":"auditd"},"fileset":{"name":"log"},"host":{"name":"ip-x-x-x-x.x-x-1.compute.internal"},"input":{"type":"log"},"kind":"Event","level":"Metadata","log":{"file":{"path":"/var/log/audit/audit.log.2"},"offset":8567725},"requestReceivedTimestamp":"2021-02-08T10:34:56.335421Z","requestURI":"/api/v1/namespaces/default/pods?limit=500","responseStatus":{"code":200,"metadata":{}},"service":{"type":"auditd"},"sourceIPs":["x.x.x.x"],"stage":"ResponseComplete","stageTimestamp":"2021-02-08T10:34:56.339951Z","user":{"groups":["oidc:x-x-x-x","oidc:x","oidc:x-x"],"username":"x"},"userAgent":"kubectl/v1.20.2 (linux/amd64) kubernetes/faecb19","verb":"get"}, Private:file.State{Id:"native::2213825-51713", PrevId:"", Finished:false, Fileinfo:(*os.fileStat)(0xc0007e88f0), Source:"/var/log/audit/audit.log.2", Offset:8568284, Timestamp:time.Time{wall:0xc00062d41ae5c4ec, ext:40110649610, loc:(*time.Location)(0x60807a0)}, TTL:-1, Type:"log", Meta:map[string]string(nil), FileStateOS:file.StateOS{Inode:0x21c7c1, Device:0xca01}, IdentifierName:"native"}, TimeSeries:false}, Flags:0x1, Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {"type":"mapper_parsing_exception","reason":"failed to parse field [error] of type [keyword] in document with id '8TA1gXcBjB55RMTVZnF5'. Preview of field's value: '{message=field [message] not present as part of path [message]}'","caused_by":{"type":"illegal_state_exception","reason":"Can't get text on a START_OBJECT at 1:340"}}
Environment
- Kubernetes 1.15.7
- filebeat 7.9.3