[9.2](backport #47870) javascript processor: replace global paths with per-beat paths #48034
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.
Proposed commit message
Changes:
Fixes #46988
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesstresstest.shscript to run them under stress conditions and race detector to verify their stability.I have added an entry in./changelog/fragmentsusing the changelog tool.How to test this PR locally
Run filebeat with:
myconfig/test_processor.js:write some logs:
See output:
{ "@timestamp": "2025-12-02T18:09:36.488Z", "@metadata": { "beat": "filebeat", "type": "_doc", "version": "9.3.0" }, "ecs": { "version": "8.0.0" }, "log": { "offset": 89586, "file": { "path": "/tmp/logs/a.log", "device_id": "38", "inode": "73159", "fingerprint": "83016ba24a8d31ccb16d2230eabcb1f043fa4c65914339eb954619b5c13fd55a" } }, "message": "some log", "input": { "type": "filestream" }, "js_processor": { "processed": true, "timestamp": "2025-12-02T18:09:36.488Z" }, "message_upper": "SOME LOG", "host": { "name": "laptop" }, "agent": { "version": "9.3.0", "ephemeral_id": "f6bb5c64-d2d1-4dad-a0e1-bbc553b617ec", "id": "40aef7d0-efcb-4613-a1df-d9bc42ff36b9", "name": "laptop", "type": "filebeat" } }Related issues
This is an automatic backport of pull request javascript processor: replace global paths with per-beat paths #47870 done by Mergify.