-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
httpjson: chain step request.url cannot be a replacement #8676
Comments
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
I'm happy to help with the doc fix if you can help me clarify:
|
@efd6 We can use a small trick to achieve this via httpjson using the replace_with attribute
This will basically create an invalid url initially NOTE: the reason we set |
Thanks @ShourieG. So the question becomes, "Do we want to document that or make it work as a user would expect?" |
Let's make it work as the user would expect documenting this will not be a good idea as its more of a hack than an actual solution. |
Thank you @ShourieG for clarifying, as doc is no longer impacted I'll remove myself and the doc label from this ticket. |
I have done some exploration of the required changes for this using a type-parametric approach (which I think would be less difficult/onerous than the code copying approach) and I believe that this is not realistically feasible to fix in the general case. The reason for this is that a functional URL is needed prior to placeholder expansion in client construction. This is not for the actual client, but for the metrics collection construction. What the work-around approach above does with the already-valid-url-prefix is to provide a hint that the client construction code needs to work. |
We have a user who was attempting to implement a chained API ingestion using the custom API integration. The API that they were experimenting with in development (https://rickandmortyapi.com/api/) returns complete URLs to link between entities in the dataset. For example, the
episode
array.The user correctly attempted to have a step that would follow the set of episodes in their testing setup.
This fails during config check with
[failed to reloading inputs: 1 error: Error creating runner from config: parse "$.episode[:]": first path segment in URL cannot contain colon accessing ''chain.0.step.request.url'']
. This happens because at thestep.request.url
must be validated as a URL, which it is not in its static form (though it would be after the replacement happens).We can either document that this is a limitation of chain replacement (and point to CEL which is able to handle this kind of API) or add logic to elide URL checking in step request URLs. The second would probably just be a flag in the
httpjson.requestConfig
to conditionally validate, though this does complicate the code since currently validation is specified in the struct tag for the URL field. So I would be inclined to document and say that it is a non-supported feature.The text was updated successfully, but these errors were encountered: