Repository navigation
Metrics from logs json parser issue #21095
A note for the community
ProblemHi, I have am trying to parse a below event to Vector via s3 and trying to fetch metrics out of it. #sample json event
I'm uploading this event to s3 and trying to get It is getting ingested BUT while testing it by printing it out to internal console logs before creating metrics can see that each event ConfigurationI want this to be parsed as single event like below Version"0.36.0-distroless-libc Debug OutputNo response Example DataAttached above Additional ContextNo response ReferencesNo response |
Replies: 2 comments
|
I converted this to a discussion. We are also discussing this in Discord: https://discord.com/channels/742820443487993987/1274053459213291611/1274058078144303236 |
|
Your screenshot shows a JSON array spread across multiple lines. The source is splitting it into lines before Use sources:
mobile_logs:
type: aws_s3
region: us-east-1
compression: auto
sqs:
queue_url: https://sqs.us-east-1.amazonaws.com/123456789012/mobile-logs
framing:
method: bytes
decoding:
codec: json
transforms:
request_metrics:
type: log_to_metric
inputs: [mobile_logs]
metrics:
- type: counter
field: request_count
name: requests
increment_by_value: true
tags:
path: "{{ path }}"
sinks:
console:
type: console
inputs: [request_metrics]
encoding:
codec: jsonUse your existing SQS notification queue. The decoded events already have I tested this on Vector 0.60.0 with a gzipped copy of the two records in your screenshot and local S3/SQS mocks. It produced counter increments of |


Your screenshot shows a JSON array spread across multiple lines. The source is splitting it into lines before
parse_jsonsees it.Use
framing.method: bytesto read the whole object and let the JSON decoder produce one event per array element: