Help Needed: Adding account-id and instance-id to Vector's S3 Sink key_prefix #21835
-
Hello everyone, I'm currently working with Vector and trying to configure the S3 sink to include both the account-id and instance-id in the key_prefix. I've experimented with several approaches, including using remap, lua, and environment variables, but haven't found a solution that is both obvious and clean. Here's what I've tried so far: Remap: Attempted to use the remap transform to modify the data before it reaches the sink, but I couldn't find a straightforward way to inject these values directly into the key_prefix. Lua: Considered using a Lua script to manipulate the data, but integrating this with the S3 sink configuration proved challenging. Environment Variables: Explored setting environment variables for these IDs and referencing them in the configuration, but this approach didn't seem to integrate well with the key_prefix. Has anyone successfully managed to include dynamic values like account-id and instance-id in the key_prefix for an S3 sink in Vector? If so, could you please share your approach or any tips you might have? Any help or guidance would be greatly appreciated! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @block-erichter ,
I'm curious what challenges you ran into with this? It should be possible to interpolate environment variables in the Is your aim to use the account-id / instance-id of the instance running Vector? If so, you could use the aws_ec2_metadata transform to annotate events with metadata from the instance and then refer to that in the |
Beta Was this translation helpful? Give feedback.
Ah, you'll need to quote
account-id
because it has a special character:{{ "account-id" }}
like: