Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Received invalid json from the Azure Cloud platform" error using the Native Azure Integration #5880

Open
zmoog opened this issue Apr 13, 2023 · 2 comments
Assignees
Labels
bug Something isn't working, use only for issues Integration:azure Azure Logs Team:obs-ds-hosted-services Label for the Observability Hosted Services team [elastic/obs-ds-hosted-services]

Comments

@zmoog
Copy link
Contributor

zmoog commented Apr 13, 2023

We are trying to ingest the Azure Function App logs using the Native Azure Integration.

The Elastic deployment is receiving the logs, but they all contain errors: the original JSON documents seem invalid.

Here's an example:

{
    "time": "2023-03-07T22:19:49Z",
    "resourceId": "/SUBSCRIPTIONS/9da0a0db-5764-4b7b-8c15-3d163c79cb78/RESOURCEGROUPS/MBRANCA-MALFORMED-JSON-RG/PROVIDERS/MICROSOFT.WEB/SITES/MBRANCA-HELLO-WORLD2",
    "category": "FunctionAppLogs",
    "operationName": "Microsoft.Web/sites/functions/log",
    "level": "Informational",
    "location": "East US",
    "properties": {'appName':'mbranca-hello-world2','roleInstance':'00888d1c-b4c0-4fc8-a6cd-3c713bc71ab6','message':'Executing Functions.hello (Reason=This function was programmatically called via the host APIs., Id=508349b3-5f75-41eb-8b37-93d55c2fcacb)','category':'Function.hello','hostVersion':'4.15.1.1','functionInvocationId':'c85e7a25-bade-4e7b-b596-53492d7cca9c','functionName':'Functions.hello','hostInstanceId':'9eb66127-a244-467e-b6a2-01879ad19da2','level':'Information','levelId': 2,'processId': 55,'eventId': 1,'eventName':'FunctionStarted'
    }
}

The document seems mostly fine, but the properties field contains an invalid JSON literal — it uses a single quote instead of double quotes.

We tried to send the same log category to an event hub, and the result is the same: the property field contains a single-quoted JSON object. So something is coming from the upstream service.

Here's how to reproduce the issue using the Dev Tools and the latest version of the integration:

POST _ingest/pipeline/logs-azure.platformlogs-1.5.13/_simulate
{
  "docs": [
    {
      "_source": {
        "tags": [
          "parse_message"
        ],
        "@timestamp": "2022-10-04T13:05:22.643+1300",
        "message": "{ \"time\": \"2023-04-11T13:35:20Z\", \"resourceId\": \"/SUBSCRIPTIONS/BE09D81E-9344-4E45-A3CA-D40F6448CDC2/RESOURCEGROUPS/ELASTIC-FUNCTION-TEST/PROVIDERS/MICROSOFT.WEB/SITES/APP-ELASTIC-EU-FUNCTION-EXAMPLE-230411151635\", \"category\": \"FunctionAppLogs\", \"operationName\": \"Microsoft.Web/sites/functions/log\", \"level\": \"Informational\", \"location\": \"West Europe\", \"properties\": {'appName':'app-elastic-eu-function-example-230411151635','roleInstance':'7FC188BD-638167119026295850','message':'Elastic Test Function Trigger. ---- West Europe West Europe West Europe West Europe West Europe ','category':'Function.HttpTriggerJava.User','hostVersion':'4.16.5.5','functionInvocationId':'484b4eb9-8acf-44d3-9fef-d0f2176a2dd3','functionName':'HttpTriggerJava','hostInstanceId':'00b42cb0-884e-43fa-967f-17247226c07c','level':'Information','levelId':2,'processId':62}}"
      }
    }
  ]
}
@zmoog zmoog added the bug Something isn't working, use only for issues label Apr 13, 2023
@zmoog zmoog self-assigned this Apr 13, 2023
@zmoog
Copy link
Contributor Author

zmoog commented Apr 28, 2023

Microsoft is considering a fix on function runtime host v5, but there is no ETA yet.

@botelastic
Copy link

botelastic bot commented Jun 8, 2024

Hi! We just realized that we haven't looked into this issue in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Jun 8, 2024
@andrewkroh andrewkroh added the Integration:azure Azure Logs label Aug 14, 2024
@botelastic botelastic bot removed the Stalled label Aug 14, 2024
@andrewkroh andrewkroh added Stalled Team:obs-ds-hosted-services Label for the Observability Hosted Services team [elastic/obs-ds-hosted-services] labels Aug 14, 2024
@botelastic botelastic bot removed the Stalled label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues Integration:azure Azure Logs Team:obs-ds-hosted-services Label for the Observability Hosted Services team [elastic/obs-ds-hosted-services]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants