Log Analytics - custom log creation failed: cannot read properties of undefined (reading 'length')

Tilman Goldboom 10 Reputation points
2024-04-10T14:20:35.9466667+00:00

Hi,
I am trying to create a custom log (DCR-based) from my Log Analytics Workspace (via the Tables section).
When going through the setup everything looks good. I can select the DCR, upload a file, transform the timestamp but when I confirm the summary to create the new table, the process fails with the following error message:

custom log creation failed cannot read properties of undefined (reading 'length').

That's the json object I am using:

[{"UserPrompt":"Some text","Language":"english","SystemInstruction":"Some text","Status":"ok","Response":"Some text","RequestId":"69b68dc1-79ea-4886-9f8e-bfdac512d66d","ResponseTimestamp":"2024-04-10T12:46:49.6705175Z"}]

That's the transform statement:

source | extend TimeGenerated = todatetime(ResponseTimestamp)

DCRs and workspaces are all deployed in "Germany West Central" and I am the owner of the Monitor Workspace as well as the Log Analytics Workspace.

Any help how to solve this issue would be much appreciated. Thanks in advance.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,804 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 20,016 Reputation points
    2024-04-19T06:10:00.93+00:00

    @Tilman Goldboom Apologies for the delayed response.

    I tested the scenario with the exact json log content and transformation query, as you had shared in the question and cannot reproduce this issue. I tested it in "Germany West Central" region as well as in other regions. Here are the possible root causes:

    1. Please check if the uploaded file which contains the sample log in JSON format does not contain illegible/non-visible characters causing the parsing to fail.
    2. It might have been a transient error - and could have been resolved on its own.

    Could you confirm if you are able to create the table now, with the required input?

    An alternative approach would be to use the steps mentioned in the link below:

    Collect logs from a text or JSON file with Azure Monitor Agent

    For the script used to create the table, you could modify it to match the schema of table you need and provide the transformation query in the Data collection rule created.

    Hope this helps.

    If the answer did not help, please add more context/follow-up question for it. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.

    0 comments No comments