Skip to content

Conversation

@Hiruma31
Copy link

@Hiruma31 Hiruma31 commented Jan 1, 2026

Summary

This change adds the file owner and group in the file source's namespace.

Vector configuration

data_dir: "/tmp/vector_data"

schema:
  log_namespace: true
# Sources - Read from files
sources:
  my_file_source:
    type: file
    include:
      - /tmp/vector/*.log     

# Transforms - Retrieve from namesapce
transforms:
  basic_remap:
    type: remap
    inputs:
      - my_file_source
    source: |
      # Add custom fields
      .environment = "production"
      .application = "my-app"
      .log.file.path = %file.path
      .log.file.owner = %file.owner
      .log.file.group = %file.group

# Sink - Output to console
sinks:
  console_output:
    type: console
    inputs:
      - basic_remap
    encoding:
      codec: json
    target: stdout
{
    "application": "my-app",
    "environment": "production",
    "log": {
        "file": {
            "group": "usergroup",
            "owner": "youruser",
            "path": "/tmp/vector/check.log"
        }
    }
}

How did you test this PR?

Thiss PR wass tested with a local build of vector 0.52.0 (x86_64-unknown-linux-gnu)

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

@Hiruma31 Hiruma31 requested a review from a team as a code owner January 1, 2026 23:12
@github-actions github-actions bot added the domain: sources Anything related to the Vector's sources label Jan 1, 2026
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Hiruma31
Copy link
Author

Hiruma31 commented Jan 1, 2026

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include file owner and group in Log Namespace

1 participant