I am writting custom logs to log analytics.
Based on the following link:
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/data-collector-api#create-a-request
I should be able to use a field in the request header called: time-generated-field
, the documentation says that: " If you specify a field, its contents are used for TimeGenerated. If you don't specify this field, the default for TimeGenerated is the time that the message is ingested. The contents of the message field should follow the ISO 8601 format YYYY-MM-DDThh:mm:ssZ"
I am passing the following value: 2021-11-11T19:52:45Z
(as a string, since you can't pass this as a datetime object) but the problem is that when I look in the log analytics workspace, the TimeGenerated field is this (today's date): 2021-12-01T18:41:04.529Z
which is the datetime the event is ingested, so basically, it's not taking the real event generated time which is 2021-11-11T19:52:45Z
which I am passing in the header.
Am I doing something wrong here?
Any help would be appreciated, I am running out of ideas here.