Skip to content

Sent payloads not valid JSON, wrapped in function call #126

@grandstairs

Description

@grandstairs

When I send a message it shows up in cloudwatch as a function call for some reason.

f, _ := fluent.New(fluent.Config{FluentPort: port, FluentHost: "localhost"})
f.Post("tag_name_here", msg) // msg is EMF payload
f.Close()
function-wrapped

I am trying to use fluent bit to post EMF payloads to a specific cloudwatch log group so I can use them for metrics.

My fluentbit configuration if it helps

[SERVICE]
    HTTP_Server  On
    HTTP_Listen  0.0.0.0
    HTTP_PORT    2020
    Flush        1
    Grace        30
    Log_Level    info
    storage.path /var/log/flb-storage/
    storage.max_chunks_up  32

[INPUT]
    Name          tcp
    Alias         TCP-ServiceMetrics
    Tag           ServiceMetrics
    Listen        0.0.0.0
    Port          5172
    Format        none
    Chunk_Size    32
    Buffer_Size   256
    storage.type  filesystem

[OUTPUT]
    Name                cloudwatch_logs
    Alias               CloudWatch-ServiceMetrics
    Match               ServiceMetrics
    region              ${LOG_REGION}
    log_group_name      SampleApp-${STAGE}-ServiceMetrics
    log_stream_prefix   ServiceMetrics-${HOSTNAME}
    log_key             log
    log_format          json/emf
    auto_create_group   false
    retry_limit         3
    endpoint            ${CLOUDWATCH_ENDPOINT}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions