Why is the activity log stored in the adls gen2 container not a valid json

zmsoft 200 Reputation points
2024-10-15T07:08:22.52+00:00

Why is the activity log stored in the adls gen2 container not a valid json?

It's line by line, and the outer layer is missing '[]' and comma separation

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,511 questions
Azure Data Lake Analytics
{count} votes

Accepted answer
  1. Vinod Kumar Reddy Chilupuri 1,915 Reputation points Microsoft Vendor
    2024-10-15T09:34:27.0766667+00:00

    Hi zmsoft,
    Welcome to Microsoft Q&A, thanks for posting your query.

    The activity log stored in the ADLS Gen2 container might consider as not valid JSON because the data is structured line by line, without following proper JSON formatting rules. A valid JSON format is required.

    JSON data must be enclosed with an array, it must be start with [ and end with ] . If the outer array is missing, the logs won't be considered as a valid JSON entity.

    JSON objects within an array must be separated by Commas. Without these commas between the log entities, the file won't confirm to JSON's Structural requirement.

    This can be often happened because the activity logs may be stored as separate lines, which may make them easier to read line by line, but it results in an invalid format when treated as a single file.

    • Add square brackets "[]" around the data.
    • Ensure each line or object is separated by a comma (except the last one).

    Reference:

    https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log?tabs=powershell

    Please let us know if you have any further queries. I’m happy to assist you further. 


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.