Issue Extracting Docker Label Value with Dots (com.test.data.job) in VRL #1268
-
|
Hi Team, I'm trying to extract a Docker label (com.test.data.job) inside a remap transform in Vector and use it as a dynamic value when writing logs to an S3 bucket. However, I keep running into type errors. What I'm Trying to Do: Errors I’m Encountering: or I also tried escaping dots ("com.test.data.job") and using an array-style lookup (get(["docker", "container_labels", "com.test.data.job"])), but none worked. My Questions:
Any guidance would be appreciated! Thanks in advance. 🚀 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Per https://vector.dev/docs/reference/vrl/functions/#get, This playground example might help. |
Beta Was this translation helpful? Give feedback.
-
|
Check out this example. I think this is what you want. Note that the |
Beta Was this translation helpful? Give feedback.
-
|
Below example worked for me
|
Beta Was this translation helpful? Give feedback.
Below example worked for me
.job_id = get(.label, ["com.test.data.job"]) ?? "unknown"