Skip to content

Autoreloading external state from file for event transforms #25203

@Voldemat

Description

@Voldemat

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

Idea is to have a file watcher inside vector that will automatically reload some file or files on filesystem when they are changed, and make content available to vrl script that is executed in remap transform or filter transform. In config it could look like a filepath and script that is run on content when file is changed to for example parse json, etc. And some key property that defines a identifier through which you can access this data in your transforms. The motivation for this very simple, there is a lot of state on the system that vector might not be aware of that is required to properly enrich collected metrics and logs before sending them to some centralized location. This information is usually easily acceptable on the node, and writing some script that would update a json file if let`s say network interfaces list change is not complicated.

Use Cases

In my case I want to have ability to resolve cilium network interfaces devices to pod ids when I collect network metrics.

Attempted Solutions

Right now vector vrl has option to send http request which in theory could be used to solve this, however I find it unsatisfactory because of the overhead, especially considering it would have to be run on each metric event.

Proposal

Here is incomplete config example to illustrate the idea:

state:
  network_interface_to_pod_id:
    filepath: /etc/somefile.json
    load_script: |
      . = parse_json!(.buffer)
transforms:
  host_metrics:
    type: remap
    inputs: ["host_metrics-input"]
    state:
      ni_to_pod_id: network_interface_to_pod_id
    source: |
      .tags.pod_id = get(ni_to_pod_id, [.tags.device]) ?? null

References

No response

Version

vector 0.54.0 (x86_64-unknown-linux-gnu 2b8b875 2026-03-10 15:47:37.284215410)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions