Skip to content

VRL compiler warns about the unused result of set_semantic_meaningΒ #1149

@sfackler

Description

@sfackler

A note for the community

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

The VRL compiler reports a warning for calls to set_semantic_meaning:

2024-11-26T02:02:17.453462Z  WARN transform{component_kind="transform" component_id=talos_kernel_logs_cleanup component_type=remap}: vector::transforms::remap: VRL compilation warning. warnings=
warning[E900]: unused result for function call `set_semantic_meaning(."talos-time", "timestamp")`
  β”Œβ”€ :1:1
  β”‚
1 β”‚ set_semantic_meaning(."talos-time", "timestamp")
  β”‚ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the result of this expression or remove it
  β”‚
  = this expression has no side-effects
  = see language documentation at https://vrl.dev
  = try your code in the VRL REPL, learn more at https://vrl.dev/examples

From looking at the docs, it seems to be true that the function has no side effects, but that it also returns no value so the warning seems wrong.

Configuration

set_semantic_meaning(."talos-time", "timestamp")

del(.clock)
del(.seq)
del(."talos-level")
."talos-time" = parse_timestamp!(."talos-time", "%+")

Version

0.42.0

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA code related bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions