Hello all,
We have an strange case, where files are deleted and created again, so the inodes changes:
File: ‘/logs-prod/log.log’
Size: 33235073 Blocks: 64920 IO Block: 1048576 regular file
Device: 2ah/42d Inode: 14727774157473967565 Links: 1
Access: 2024-04-04 10:50:21.429000000 -0400
Modify: 2024-04-04 10:50:21.429000000 -0400
Change: 2024-04-04 10:50:21.429000000 -0400
Birth: -
File: ‘/logs-prod/log.log’
Size: 70778683 Blocks: 138240 IO Block: 1048576 regular file
Device: 2ah/42d Inode: 14727774157473967565 Links: 1
Access: 2024-04-04 10:51:21.749000000 -0400
Modify: 2024-04-04 10:51:21.749000000 -0400
Change: 2024-04-04 10:51:21.749000000 -0400
Birth: -
File: ‘/logs-prod/log.log’
Size: 107995136 Blocks: 210928 IO Block: 1048576 regular file
Device: 2ah/42d Inode: 14727774157473967565 Links: 1
Access: 2024-04-04 10:52:22.005000000 -0400
Modify: 2024-04-04 10:52:22.005000000 -0400
Change: 2024-04-04 10:52:22.005000000 -0400
Birth: -
File: ‘/logs-prod/log.log’
Size: 154500582 Blocks: 301760 IO Block: 1048576 regular file
Device: 2ah/42d Inode: 14727774157473967565 Links: 1
Access: 2024-04-04 10:53:27.302000000 -0400
Modify: 2024-04-04 10:53:27.302000000 -0400
Change: 2024-04-04 10:53:27.302000000 -0400
Birth: -
File: ‘/logs-prod/log.log’
Size: 189079723 Blocks: 369304 IO Block: 1048576 regular file
Device: 2ah/42d Inode: 14727774157473967565 Links: 1
Access: 2024-04-04 10:54:22.500000000 -0400
Modify: 2024-04-04 10:54:22.500000000 -0400
Change: 2024-04-04 10:54:22.500000000 -0400
Birth: -
File: ‘/logs-prod/log.log’
Size: 18041365 Blocks: 35240 IO Block: 1048576 regular file
Device: 2ah/42d Inode: 3240669014096275375 Links: 1
Access: 2024-04-04 10:55:17.776000000 -0400
Modify: 2024-04-04 10:55:17.776000000 -0400
Change: 2024-04-04 10:55:17.776000000 -0400
Birth: -
File: ‘/logs-prod/log.log’
Size: 72428999 Blocks: 141464 IO Block: 1048576 regular file
So we configured filebeat with this parameters:
- type: log
file_identity.path: ~
close_timeout: 2m
id: logs
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- ‘/logs-prod/log.log’
But still I can see errors with file deletion:
{"log.level":"error","@timestamp":"2024-04-04T10:32:32.294-0400","log.logger":"input.harvester","log.origin":{"function":"github.com/elastic/beats/v7/filebeat/input/log.(*Log).checkFileDisappearedErrors","file.name":"log/log.go","file.line":173},"message":"Unexpected error reading from /logs-prod/log.log; error: stat /logs-prod/log.log: stale NFS file handle","service.name":"filebeat","input_id":"bf7df23f-cdf9-4475-915c-7320b030a80f","source_file":"/logs-prod/log.log","state_id":"path::/logs-prod/log.log","finished":false,"os_id":"4389460513228081789-42","old_source":"/logs-prod/log.log","old_finished":true,"old_os_id":"4389460513228081789-42","harvester_id":"d69f2cda-d00e-445f-9a06-5548a91356ee","ecs.version":"1.6.0"}
What I'm doing wrong?
Greetings,