Skip to content
Discussion options

You must be logged in to vote

Your screenshot shows a JSON array spread across multiple lines. The source is splitting it into lines before parse_json sees it.

Use framing.method: bytes to read the whole object and let the JSON decoder produce one event per array element:

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:
 …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
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:log_to_metric Anything `log_to_metric` transform related source:aws_s3 Anything `aws_s3` source related
3 participants
Converted from issue

This discussion was converted from issue #21094 on August 16, 2024 19:33.