Garbem
Garbem

Reputation: 169

Azure Data Explorer Data Connection DataFormat

What is the difference between JSON and MULTIJSON data format? Isn't it all a JSON? When should we use one or the other? How should the payload look when using one or the other?

Upvotes: 1

Views: 793

Answers (1)

Yoni L.
Yoni L.

Reputation: 25955

please see: https://learn.microsoft.com/en-us/azure/data-explorer/ingest-json-formats?tabs=kusto-query-language#the-json-format

Azure Data Explorer supports two JSON file formats:

json: Line separated JSON. Each line in the input data has exactly one JSON record.

multijson: Multi-lined JSON. The parser ignores the line separators and reads a record from the previous position to the end of a valid JSON.

and: https://learn.microsoft.com/en-us/azure/data-explorer/ingestion-supported-formats

JSON: A text file with JSON objects delimited by \n or \r\n. See JSON Lines (JSONL).

MultiJSON: A text file with a JSON array of property bags (each representing a record), or any number of property bags delimited by whitespace, \n or \r\n. Each property bag can be spread on multiple lines. This format is preferred over JSON, unless the data is non-property bags.

you should choose according to how your source data is formatted. if in doubt, choose multijson, as it 'contains' json.

example for json with 2 records:

{"Hello":"World"}
{"Foo":{"Bar":"x"}}

example for multijson with 2 records:

{
   "Hello": "World"
}
{   
    "Foo": {
       "Bar": "x"
    }
}

Upvotes: 2

Related Questions