Repository navigation
Conversation
CompactObject.shouldEncode now passes the joined key to TenXLookup.get as a string. The lookup hashes a key's characters, but a templateHash field value carries the template's numeric hash and was looked up by that, so with fieldNames [templateHash] no event ever matched (0 of 662 compact with all 96 template hashes listed). A message_pattern key is already a string, so cap files keyed on it behave as before. config.yaml now says how to key on the template and that hashes are quoted in the cap file. Checked with the engine (1.1.153 jar) on a Windows Security sample of 662 events and 96 templates, with the output field `encoded=shouldEncode() ? encode() : fullText(...)`: every hash listed, 662 of 662 compact; every second hash listed, exactly the 264 events of the 48 listed templates compact and the other 398 written whole, equal to the input; rows that expired an hour ago, 0 compact; rows that expire in a day, 662 compact; a message_pattern cap file, output byte-identical to main. On the 7,649-event EventID 4663 sample repeated twice (1,783 templates, 224 of them needing quotes), every hash listed, 15,298 of 15,298 compact. `node --test tests/`: 15 of 15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rate receiver's mute lookup (rate-object-lookup.js and
rate-object-lookup-cap.js) now passes the joined key to TenXLookup.get as a
string, as CompactObject.shouldEncode does. With fieldNames [templateHash] the
key is the field value itself, which carries the template's numeric hash, and
the lookup hashes a key's characters, so no mute entry ever matched. A key of
message_pattern, or of several fields joined, is already a string, so mute
files keyed on them behave as before.
Checked with the engine (1.1.153 jar) on a Windows Security sample of 662
events and 96 templates, rate receiver with fieldNames [templateHash], output
filtered on !isRoute("drop"), with and without a cap file (both scripts):
every hash muted (0.0, until tomorrow), main 662 written, this change 0;
every second hash muted, main 662, this change 398, exactly the events of
the 48 unlisted templates in their order; every hash muted with an expired
entry, 662 on both, output byte-identical. A message_pattern mute file (0 of
662 written) and no mute file (662): output byte-identical to main.
`node --test tests/`: 15 of 15.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A compact cap file keyed on
templateHashnow matches:CompactObject.shouldEncodepasses the joined key toTenXLookup.getas a string. The lookup hashes a key's characters, but atemplateHashfield value carries the template's numeric hash and was looked up by that, so withfieldNames: [templateHash]no event ever matched (0 of 662 compact with all 96 template hashes listed). Amessage_patternkey is already a string, so cap files keyed on it behave as before.What changed
pipelines/run/receive/compact/compact-object-cap.js:TenXLookup.get("compactReceiverLookupFile", "" + fieldSetKey). The cap-file format, thetrue|false[:untilEpochSec[:reason]]values, row expiry,compactReceiverDefaultandreceiverOptimizeare unchanged.pipelines/run/receive/compact/config.yaml: a comment on keying bytemplateHashand quoting each hash in the cap file (a hash can start with#, the CSV comment character, or hold a space; the hash alphabet has no"or,).Checked
Engine 1.1.153 (jar) on a Windows Security XML sample (662 events, 96 templates), with the Splunk settings (no back-references, UTC, one timestamp per event) and the forwarder output's field
encoded=shouldEncode() ? encode() : fullText("tenx_passthrough"); each event's template known from the run with every hash listed.templateHash, all 96 hashes, main's scripttemplateHash, all 96 hashestemplateHash, every second hash (48)templateHash, all 96, rows expired an hour agotemplateHash, all 96, rows that expire in a daymessage_pattern, one rowOn the EventID 4663 sample repeated twice (15,298 events, 1,783 templates, 224 of the hashes needing quotes), every hash listed: 15,298 of 15,298 compact.
Time per event: whole runs on the two samples (662 events repeated 30 times, 5 rounds per arm; 4663 repeated twice, 3 rounds), with no cap entry matching (main's script and key), with this change, and with a one-column list tested by
lookupMatch(the other way to key on the template, which has no row expiry):lookupMatch, every hash listedlookupMatch, every hash listedThe spread within an arm is larger than any difference between arms, so no cost per event was measurable on this machine at these sizes. The lookup keeps 100 rows in memory and reads a listed key's row from the file on a miss (
BaseFileCachedLookup,TextFileLookup.readLine); with 1,783 listed templates most lookups take that path, and it did not show either.node --test tests/: 15 of 15.Rate receiver: the same key in its mute lookup
The rate receiver's mute file had the same defect:
rate-object-lookup.jsandrate-object-lookup-cap.jspassfieldSetKeyfromjoinFieldstoTenXLookup.get, so withrateReceiver.fieldNames: [templateHash]no mute entry ever matched. The second commit passes it as a string the same way.Checked with the engine (1.1.153 jar), Windows Security sample of 662 events and 96 templates, the rate receiver keyed on
templateHash(fieldNames: [templateHash]in its config), output filtered on!isRoute("drop"), each case once with no cap file (rate-object-lookup.js) and once with a cap file of one*row far above the data (rate-object-lookup-cap.js), same counts in both:0:<tomorrow>0:<tomorrow>message_patternkey (the default),0:<tomorrow>node --test tests/: 15 of 15.🤖 Generated with Claude Code