Skip to content

[azure_functions] Handle stringified properties with single quotes in ingest pipeline #11729

@zmoog

Description

@zmoog

Users reported receiving a different log format for Azure Functions.

Depending on the hosting plan, Azure Functions logs may contain invalid JSON documents like the following:

{
    "category": "FunctionAppLogs",
    "location": "useast",
    "properties": {
        'appName': 'myapp'
    }
}

However, on some deployments, it seems that Azure Functions now sends invalid JSON wrapped in a string:

{
    "category": "FunctionAppLogs",
    "location": "useast",
    "properties": "{'appName': 'myapp'}"
}

This makes the JSON document formally valid. However, the sanitizer won't change the single quote inside the JSON string.

When Azure wraps the invalid JSON in a string, the platformlogs pipeline fails with the following error:

expecting token of type [START_OBJECT] but found [VALUE_STRING] 

Metadata

Metadata

Assignees

Labels

Integration:azure_functionsAzure FunctionsTeam:Obs-InfraObsObservability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]Team:Service-IntegrationsLabel for the Observability Service Integrations teambugSomething isn't working, use only for issues

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions