Skip to content

remap host metrics not working #24413

@lake2

Description

@lake2

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

timezone: 'Asia/Shanghai'
log_schema:
    host_key: 'vector.host'
    source_type_key: 'vector.source'
    timestamp_key: 'vector.timestamp'

sources:
    host_metrics:
        type: host_metrics
        collectors: ['memory']
        scrape_interval_secs: 5

transforms:
    host_metrics_json:
        type: remap
        inputs:
            - host_metrics
        source: |
            .a = "========"
            log(.) # <======== object not change here
sinks:
    debug:
        inputs:
            - host_metrics_json
        type: 'console'
        encoding:
            codec: 'json'
            # json:
            #     pretty: true
            timestamp_format: 'rfc3339'

output:

{"name":"memory_swapped_in_bytes_total","namespace":"host","tags":{"collector":"memory","host":"553e058dca01"},"timestamp":"2025-12-25T15:24:38.192509810Z","kind":"absolute","counter":{"value":0.0}}

command:

docker run -it --rm \
  --name vector-dev \
  --network log \
  -v /proc:/host/proc:ro \
  -v /sys:/host/sys:ro \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -v $PWD/vector2.yaml:/etc/vector/vector.yaml:ro \
  -e PROCFS_ROOT=/host/proc \
  -e SYSFS_ROOT=/host/sys \
  timberio/vector:0.52.0-alpine \

Configuration


Version

0.52.0

Debug Output


Example Data

No response

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA code related bug.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions