Skip to content
Discussion options

You must be logged in to vote

This handles both examples and writes a console-style line to .message:

fields = object!(.)
metadata = del(fields.metadata)
span = del(fields.vector)
message = string!(del(fields.message))
del(fields.timestamp)
prefix = string(metadata.target) ?? "vector"
if is_object(span) {
  prefix = (string(span.component_kind) ?? "component") + "{" + encode_key_value!(span) + "}: " + prefix
}
.message = prefix + ": " + message
extra = encode_key_value(fields)
if extra != "" {
  .message = .message + " " + extra
}

The component prefix is included when .vector exists. Other fields are formatted as key-value pairs, while the original structured fields remain available on the event. The field order and …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jszwedko
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by pront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
transform:remap Anything `remap` transform related source:internal_logs Anything `internal_logs` source related
3 participants