Commit 249dd71
committed
POC: filestream growing fingerprint identity
Add a proof-of-concept for a new "growing_fingerprint" file identity mode
that addresses the limitation where files smaller than the fingerprint size
(default 1024 bytes) cannot be tracked.
### Key changes:
- Add growingFingerprintIdentifier that stores raw bytes (hex-encoded) instead
of a hash, allowing the fingerprint to grow as the file grows
- Files can be tracked immediately regardless of size (no minimum threshold)
- Implement prefix matching: when a file grows, match the old (shorter)
fingerprint as a prefix of the new (longer) fingerprint
- Add IterateOnPrefix() and UpdateKey() to the store for registry key migration
- Support in-place key updates without interrupting running harvesters
- Default max_length is 1000 bytes (matching OTEL's filelog receiver)
Configuration:
```
prospector.scanner:
fingerprint.growing: true
fingerprint.max_length: 1000 # optional, default 1000
file_identity.growing_fingerprint: ~
```
This enables tracking small files that share initial content (e.g., common
headers) by allowing their fingerprints to diverge as they grow with
unique content.
### Includes integration tests covering:
- Small files tracked immediately
- Files with identical initial content differentiated as they grow
- Fingerprint migration on file growth
- Restart scenarios
### Open question/issue
Using the raw bytes (hex-encoded) as the fingerprint makes it easier to compare
prefix matches, however increases the memory consumption, up to 1000 bytes per
file per in-memory instance of the fingerprint. Also, it increases the storage
used by the registry on disk.1 parent 061db97 commit 249dd71
File tree
12 files changed
+1245
-31
lines changed- filebeat
- input/filestream
- internal/input-logfile
- tests/integration
- libbeat/tests/integration
12 files changed
+1245
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | 267 | | |
269 | 268 | | |
270 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
173 | 186 | | |
174 | 187 | | |
175 | 188 | | |
| |||
189 | 202 | | |
190 | 203 | | |
191 | 204 | | |
| 205 | + | |
192 | 206 | | |
193 | 207 | | |
194 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
195 | 216 | | |
196 | 217 | | |
197 | 218 | | |
| |||
244 | 265 | | |
245 | 266 | | |
246 | 267 | | |
| 268 | + | |
| 269 | + | |
247 | 270 | | |
248 | 271 | | |
249 | 272 | | |
| |||
300 | 323 | | |
301 | 324 | | |
302 | 325 | | |
| 326 | + | |
| 327 | + | |
303 | 328 | | |
304 | 329 | | |
305 | 330 | | |
| |||
371 | 396 | | |
372 | 397 | | |
373 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
374 | 405 | | |
375 | 406 | | |
376 | 407 | | |
| |||
386 | 417 | | |
387 | 418 | | |
388 | 419 | | |
389 | | - | |
390 | | - | |
391 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
392 | 425 | | |
393 | 426 | | |
394 | 427 | | |
395 | 428 | | |
396 | 429 | | |
397 | 430 | | |
398 | 431 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
405 | 439 | | |
406 | 440 | | |
407 | 441 | | |
| |||
413 | 447 | | |
414 | 448 | | |
415 | 449 | | |
416 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
417 | 455 | | |
418 | 456 | | |
419 | 457 | | |
| |||
473 | 511 | | |
474 | 512 | | |
475 | 513 | | |
| 514 | + | |
476 | 515 | | |
477 | 516 | | |
478 | 517 | | |
| |||
513 | 552 | | |
514 | 553 | | |
515 | 554 | | |
| 555 | + | |
| 556 | + | |
516 | 557 | | |
517 | 558 | | |
518 | 559 | | |
| |||
609 | 650 | | |
610 | 651 | | |
611 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
612 | 658 | | |
613 | 659 | | |
614 | 660 | | |
| |||
684 | 730 | | |
685 | 731 | | |
686 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
687 | 791 | | |
688 | 792 | | |
689 | 793 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
Lines changed: 32 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
105 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
106 | 134 | | |
107 | 135 | | |
108 | | - | |
| 136 | + | |
109 | 137 | | |
110 | 138 | | |
111 | 139 | | |
| |||
0 commit comments