Repository navigation
Parse nested fields for kinesis sink partition key? #20293
|
I'm currently configuring Vector sinks to send data to an AWS Kinesis Stream. My input data consists of JSON objects with nested fields, and I need to use one of these nested fields (specifically _session_id) as the partition key for the Kinesis Stream. Here is a sample of the data: Previously, I had the Here's a snippet of my current configuration: [sinks.kinesis_sink]
type = "aws_kinesis_streams"
inputs = ["json_parser"]
partition_key_field = "data[0].attributes._session_id"
compression = "none"
region = "%%AWS_REGION%%"
stream_name = "%%AWS_KINESIS_STREAM_NAME%%"
acknowledgements.enabled = true
request_retry_partial = true
request.retry_attempts = 4
request.retry_max_duration_secs = 3
[sinks.kinesis_sink.encoding]
codec = "json"and: Is there a way to configure Vector sinks to properly parse nested fields for the Kinesis Stream partition key? Alternatively, are there any adjustments needed in my Vector configuration or transformation logic to ensure the correct parsing of nested fields? Any insights or suggestions would be greatly appreciated. Thank you! |
Replies: 1 comment
|
The nested path works, but Here is your remap program with the session ID extracted into a top-level field, keeping The sink can then use sinks:
kinesis_sink:
type: aws_kinesis_streams
inputs: [json_parser]
region: us-east-1
stream_name: your-stream-name
partition_key_field: session_id
compression: none
encoding:
codec: jsonUse your stream name and region. I tested this on Vector 0.60.0 against a local Kinesis mock and captured |
The nested path works, but
.data = del(.message)stores the raw request body as a string. It does not parse the JSON inside it.Here is your remap program with the session ID extracted into a top-level field, keeping
.datain its existing string format: