question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Log Ingestion returns 204 but no logs written

See original GitHub issue

Library name and version

Azure.Monitor.Ingestion 1.0.0

Describe the bug

I am using the new package to try to write logs to a data collection endpoint. I get a response of 204 but no logs are ever written to my custom log.

Expected behavior

I expect the logs to be written to the destination (Log Analytics Workspace) under the Custom Table I created

Actual behavior

I get a 204 response, but the logs are never written. Below is an output that is logged: Azure.Core: Information: Request [b38813bf-7ffa-45cf-9aa1-c5c871fea934] POST https://dce-statusnow-prd-easg.eastus-1.ingest.monitor.azure.com/dataCollectionRules/dcr-8ba104057eaa4ceb90bcae74d6af1a18/streams/Custom-UsageLogs_CL?api-version=2023-01-01 Accept:application/json x-ms-client-request-id:b38813bf-7ffa-45cf-9aa1-c5c871fea934 x-ms-return-client-request-id:true User-Agent:azsdk-net-Monitor.Ingestion/1.0.0 (.NET 7.0.2; Microsoft Windows 10.0.22621) Authorization:Bearer [Removed] Content-Type:application/json Content-Encoding:REDACTED client assembly: Azure.Monitor.Ingestion

Also the request/response from Fiddler: Request POST https://dce-statusnow-prd-easg.eastus-1.ingest.monitor.azure.com/dataCollectionRules/dcr-8ba104057eaa4ceb90bcae74d6af1a18/streams/Custom-UsageLogs_CL?api-version=2023-01-01 HTTP/1.1 Host: dce-statusnow-prd-easg.eastus-1.ingest.monitor.azure.com Accept: application/json x-ms-client-request-id: 88ad951d-b300-48f5-84bf-78aa3d578bbe x-ms-return-client-request-id: true User-Agent: azsdk-net-Monitor.Ingestion/1.0.0 (.NET 7.0.2; Microsoft Windows 10.0.22621) Authorization: Bearer traceparent: 00-2f072f70504932658151569a0c974518-2e32054aa06e01ae-00 Content-Type: application/json Content-Length: 69

{“ActionName”:“Global Search”,“UserEmail”:“sscowden@asmgroupinc.com”}

Response HTTP/1.1 204 No Content Server: Microsoft-HTTPAPI/2.0 Strict-Transport-Security: max-age=31536000; includeSubDomains; preload x-ms-request-id: b9e2a0a1-9112-411a-aff1-e8c0f74a3a5b X-Content-Type-Options: nosniff x-ms-client-request-id: 88ad951d-b300-48f5-84bf-78aa3d578bbe Date: Wed, 01 Mar 2023 19:23:08 GMT

Reproduction Steps

var data = new AzureLogUsageMessage()
{
    ActionName = actionName,
    UserEmail = userResolverService.GetEmail()
};

var response = await logsIngestionClient.UploadAsync(RuleId, StreamName, RequestContent.Create(data)).ConfigureAwait(false);

Environment

.NET SDK: Version: 7.0.102 Commit: 4bbdd14480

Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.102\

Issue Analytics

  • State:open
  • Created 7 months ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
EvelynHoltznercommented, Mar 9, 2023

@scowdenconsulting I was recently struggling with this behavior as well, solution was to send everything as a JSON array by enclosing our JSON data in Square Brackets.

1reaction
sscowdencommented, Mar 7, 2023

Unfortunately, not yet. They replied initially asking for more information but I haven’t heard back yet. I replied yesterday asking for an update. Will update this thread when they do get back to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to send logs to Log Analytics workspace using ...
204 response is normal and correct. After few minutes you should see the logs ingested to the corresponding table.
Read more >
Is there a workaround for Postman's bug when content is ...
The 204 (204 NO CONTENT) response from the server means that the server processed your request successfully and a response is not needed....
Read more >
Archive Microsoft 365 Defender logs | by Koos Goossens
I've recently wrote an article about Microsoft Sentinel Basic and Archive logs and the new custom log ingestion API with Data Collection ...
Read more >
Logging @ Klaviyo: How we log 10 billion events a day!
Logging has always been a go-to solution for engineers to debug their code and understand how it's behaving in production. And this doesn't ......
Read more >
HTTP status and error codes for JSON | Cloud Storage
The following document provides reference information about the status codes and error messages that are used in the Cloud Storage JSON API.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found