-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Check lookup path syntax at compile time #13033
Labels
type: feature
A value-adding code addition that introduce new functionality.
Comments
fuchsnj
added
the
type: feature
A value-adding code addition that introduce new functionality.
label
Jun 8, 2022
9 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 14, 2023
This part of #13033. Tried this with a config where `source_type_key` is: * `""` --> no source entry * not defined --> same as above * `"foo"` --> `"foo":"demo_logs"` * `"foo.bar"` --> `"foo":{"bar":"demo_logs"}` * `"foo.."` --> `Configuration error. error=Invalid field path "foo.."` The config: ``` data_dir = "/Users/pavlos.rontidis/my_tests/vector" [log_schema] source_type_key = "foo" [sources.source0] format = "json" type = "demo_logs" [sinks.sink0] inputs = ["source0"] target = "stdout" type = "console" [sinks.sink0.encoding] codec = "json" ```
This was referenced Jul 14, 2023
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 18, 2023
This part of #13033. Summary of these changes: * LogSchema::host_key is now an `OptionalValuePath` * `host_key`s that appear in configs are now also `OptionalValuePath`s * There should be no `unwrap()` calls outside of tests. --------- Co-authored-by: Stephen Wakely <fungus.humungus@gmail.com>
This was referenced Jul 19, 2023
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 21, 2023
## Motivation This part of #13033. ## Summary * `LogSchema::message_key` is now an `OptionalValuePath`. * To avoid hacky `String` to `&'static str` conversions, I changed the `Requirement::meaning` key type to `String`.
There are very few places where we are still parsing the path. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A note for the community
Proposal
Today lookup paths outside of a VRL context (ex: in a transform config) are parsed at runtime. If the path has an invalid syntax, it is not detected until runtime and will just not match anything. There is no error or warning generated. This is not a great user experience. The path syntax should be checked at compile time and an error shown to the user if the syntax is invalid. Ideally this would happen when the path is pre-parsed (for performance).
Version
master
The text was updated successfully, but these errors were encountered: