gsscoder
gsscoder

Reputation: 3392

ADX: can't see results of ingesting with JSON mappings

I simplified original code to make things clearer.

I've created a one field table:

.create table testtbl (dummy: string)

Then I tried to ingest inline a small JSON document:

.ingest inline into table testtbl with (format="json", ingestionMapping =
'['
'    {"column": "dummy", "path": "$.test"}'
']') <| 
'{"test": "this is a test"}'

The statement is execute without errors:

enter image description here

But the table remains empty.

What am I missing?

Regards, Giacomo S. S.

Upvotes: 0

Views: 586

Answers (1)

Yoni L.
Yoni L.

Reputation: 25895

  1. Looking at the documentation for ingestion mappings, the format you use in your mapping is different. You may want to adjust it (e.g. It doesn't include the "properties" property bag). See: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/mappings#example-of-json-mapping

  2. The linebreak and single quotes surrounding your payload (after the "<|") are redundant.

  3. This works:

    .create table testtbl (dummy: string)
    
    .ingest inline into table testtbl
    with (format = "json", ingestionMapping = '[{"column":"dummy", "Properties": 
    {"Path": "$.test"}}]')
    <|{"test": "this is a test"}
    

    target table contents

Upvotes: 2

Related Questions