Enhancement for sink config to refer to (the resolved) global timezone name #19685
Closed
klondikedragon
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
This is interesting! One additional way to implement this would be to add a VRL function for fetching it where it could be added to the event metadata (like |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using the http sink. I want to let the server know the timezone name (e.g., America/Chicago) that is configured for this vector system (the value of the global timezone configuration entry, or if the timezone is configured to "local" ideally vector would get and use the actual timezone name (e.g., America/Chicago) from the host OS).
This can help the server do the right thing if the server is parsing/processing unstructured textual log data that it receives, and it needs to know how to treat text timestamps that it's detecting/parsing if they do not have an explicit timezone. Right now vector configuration can refer to environment variables or secrets, but it doesn't appear it can refer to global configuration values. Is it currently possible for a sink configuration value (e.g., the http sink uri or header) to refer to the value of the timezone?
Possible ways this could be implemented:
TimeZone::Local
to the actual local timezone name). This does overload environment variable interpolation with a special value, so maybe it's not as clean an approach as would be desired. On the other hand, setting an actual environment variable could be beneficial for other places, like the exec source. That could get messy after a while if a lot of configuration values became set environment variables...CONFIG[timezone]
-- on quick inspection, this would probably require a lot more code changes than just adding a special environment variable with the resolved timezone name.cx.globals.timezone
into a request header, but that is less general, and it feels like other vector users might also want to send what the locally configured timezone is to a sink.Beta Was this translation helpful? Give feedback.
All reactions