Kafka messages sink to Clickhouse #8663
-
Hello all, We are trying to get JSON messages from Kafka into Clickhouse, following the Source and Sink connectors we are getting some residual JSON fields from Kafka that we do not need in Clickhouse, we just need the JSON payload. We need only what is inside message: Any help is appreciated, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
It looks like you could just do a
Assuming |
Beta Was this translation helpful? Give feedback.
-
For further development, is there a way for quick checks on VRL? Like running test in console? Would be great to have a test tool to speedup the development process.
With kind regards,
Alex
…Sent from my iPhone
On 13 Aug 2021, at 09:21, 24igbories ***@***.***> wrote:
Thanks a lot for the suggestion,
Actually I tried it and it gave me a null message in the vector logs but I actually got the result I wanted from your code by just removing the the " . = .message" in source,
the pars_json on the message itself did the trick :
transforms.kafka_transform]
type = "remap"
inputs = [ "kafka_logs" ]
source = """
. = parse_json!(.message)
"""
drop_on_abort = true
I can see my messages flow into Clickhouse now,
Thanks a lot for the help !
I
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Beta Was this translation helpful? Give feedback.
It looks like you could just do a
remap
transform with the following VRL source:Assuming
.message
is an object already, if it's just a string you'd need to parse it first.