Q&A - How can I filter out command charachters with vector transforms? #23356
Unanswered
solarisfire
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Some of my kubernetes pods install a few packages with python pip as they spin up.
pip spawns a bunch of spinner/loading bar junk and a new empty line seems to be sent to the sink for every update to the length of the loading bar, example:
2025-07-10 15:47:09.659
readline-8.2 | 357 KB | ########## | 100% �[A�[A�[A�[A�[A�[A�[A�[A�[A�[A�[A�[A�[A�[A�[A
Is there a simple transform I can do to just drop all of these characters?
Vector Config
I've been trying stuff like:
if !exists(.message) || .message == "" || match(.message, r"^[\x1B[]A-Za-z0-9;|#%= -]{0,10}\x1B[A.") || match(.message, r"^\s[#=-~|]+\s*$") { abort }
.message = replace(.message, r"\x1B[[0-9;]*[A-Za-z]", "", "g")
._msg = .message
parsed = parse_json(.message) ?? {}
. = merge!(., parsed)
del(.message)
Vector Logs
unexpected error: invalid escape character: \x
Beta Was this translation helpful? Give feedback.
All reactions