vectordotdev / vector

A high-performance observability data pipeline.
https://vector.dev
Mozilla Public License 2.0
18.2k stars 1.6k forks source link

parse_etld function has incorrect check for quantity of options #21868

Open johnhtodd opened 6 hours ago

johnhtodd commented 6 hours ago

A note for the community

Problem

The parse_etld function indicates that it can only have two arguments, but there are more combinations possible than that. See example of the use of "plus_parts" and "psl" at the same time, and also the object being looked up.

Configuration

No response

Version

vector 0.42.0

Debug Output

No response

Example Data


x Transform "etld1_preparse":
error[E106]: wrong number of function arguments
   ┌─ :12:48
   │
12 │   .responseData.question[0].etld = parse_etld!(.responseData.question[0].domainName, plus_parts: 1, psl: "/etc/vector/public_suffix_list.dat")
   │                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   │                                                │
   │                                                too many function arguments
   │                                                this function takes a maximum of 2 arguments
   │
   = see documentation about function arguments at https://vrl.dev/expressions/#arguments
   = learn more about error code 106 at https://errors.vrl.dev/106
   = see language documentation at https://vrl.dev
   = try your code in the VRL REPL, learn more at https://vrl.dev/examples

Additional Context

No response

References

No response