x-pack/filebeat/input/httpjson: add httpjson-to-cel Redirector#49614
Draft
efd6 wants to merge 4 commits intoelastic:mainfrom
Draft
x-pack/filebeat/input/httpjson: add httpjson-to-cel Redirector#49614efd6 wants to merge 4 commits intoelastic:mainfrom
efd6 wants to merge 4 commits intoelastic:mainfrom
Conversation
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
Vale Linting ResultsSummary: 2 suggestions found 💡 Suggestions (2)
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
Contributor
🔍 Preview links for changed docs |
4cbe48d to
78c339c
Compare
Contributor
Author
|
re: vale linter
|
78c339c to
118dc97
Compare
118dc97 to
cdb29b4
Compare
cdb29b4 to
f7641f4
Compare
… migration Add an optional Redirector interface to the v2 input system so the Loader can transparently redirect one input type to another. This replaces the bespoke approach where logv2 directly imported and instantiated the filestream plugin. The Loader checks for Redirector before calling Create. If Redirect returns a non-empty target type, the Loader resolves the target from its plugin registry and calls its Create with the translated config. Only one redirect hop is allowed. Delete follows the same redirect path so CheckConfig cleanup operates on the correct target. Refactor the logv2 manager to implement Redirector instead of holding a direct reference to the filestream manager. This removes logv2's import of the filestream package, eliminates a duplicate filestream manager instance (and its redundant Init call), and makes the pattern reusable for future V2-to-V2 migrations such as httpjson to cel.
Implement the Redirector interface on httpjson's InputManager so that when run_as_cel is true and cel.program is present, the Loader redirects to the cel input with a translated config. convertHttpjsonToCel maps the full set of shared fields between the two inputs: interval, auth, request.url to resource.url, retry, redirect, keep_alive, tracer, and inline transport settings (ssl, timeout, proxy_url, proxy_headers, proxy_disable, idle_connection_timeout). cel-namespaced fields (program, state, regexp, xsd, max_executions, redact) are extracted to their top-level equivalents. Fields specific to httpjson's declarative config (method, body, transforms, response, cursor, chain) are excluded since the CEL program handles them directly. max_executions uses Int/SetInt to match its *int type in the cel config rather than round-tripping through strings.
Read the httpjson cursor from the persistent store during Redirect and inject it into the translated cel config's state.cursor field. The cel input uses config.State["cursor"] as the initial value when no stored cursor exists, so the first run after redirect continues from where httpjson left off. Subsequent runs use the cel-stored cursor and ignore the injected value. Direct store writes are not viable because the Loader calls Init on all plugin managers (loading the cel cursor manager's in-memory table) before any Configure call where Redirect runs. A cel:: key written to the persistent store during Configure would not appear in the in-memory table, and findOrCreate would overwrite it with an empty resource on first flush. The httpjson store entry is preserved for rollback safety.
Add reference documentation for the run_as_cel option and the cel.program, cel.state, cel.max_executions, cel.regexp, cel.xsd, and cel.redact configuration fields. Includes a field mapping table, a note on cursor state migration, and a worked example.
f7641f4 to
d2a44e8
Compare
6 tasks
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.
Proposed commit message
Note
Best reviewed commitwise.
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs