This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

CreateCustomLogEvents

1 - 1.1

post /v1/log-groups/log-streams/log-events

Description

Create custom log events

State ACTIVE (CURRENT)

VersionSupported Until
1.1-

Parameters

TypeNameDescriptionSchemaDefault
bodybody
required

CustomLogEventsCreateRequest

Responses

HTTP CodeDescriptionSchema
202AcceptedCustomLogEventsCreateResponse
400Bad RequestNone
401UnauthorizedNone
403ForbiddenNone

Example HTTP request

Request path

/v1/log-groups/log-streams/log-events

Request header

"Scp-Accesskey = 2sd2gg=2agbdSD26svcD",
"Scp-Signature = fsfsdf235f9U35sdgf35Xsf/qgsdgsdg326=sfsdr23rsef=",
"Scp-Timestamp = 1605290625682",
"Scp-ClientType = Openapi",
"Accept-Language = en-US",
"Scp-Api-Version = servicewatch 1.1"

Request body

{
    "resourceLogs": [
        {
            "resource": {
                "attributes": [
                    {
                        "key": "log_stream_value",
                        "value": {
                            "stringValue": "a1e2f3045678901a2b3c4d5e6f7a8b81"
                        }
                    },
                    {
                        "key": "log_group_value",
                        "value": {
                            "stringValue": "b1e2f3045678901a2b3c4d5e6f7a8b81"
                        }
                    },
                    {
                        "key": "account_id",
                        "value": {
                            "stringValue": "c1e2f3045678901a2b3c4d5e6f7a8b81"
                        }
                    }
                ]
            },
            "scopeLogs": [
                {
                    "logRecords": [
                        {
                            "body": {
                                "stringValue": "level=info otlp test log"
                            },
                            "timeUnixNano": "1762336464000000000"
                        }
                    ]
                }
            ]
        }
    ]
}

Example HTTP response

Response 202

{
    "status": "success"
}