You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LightIngest "Data Source=https://{Cluster name and region}.kusto.windows.net;AAD Federated Security=True" -db:{Database} -table:Trips -source:"https://{Account}.blob.core.windows.net/{ROOT_CONTAINER};{StorageAccountKey}" -pattern:"*.csv.gz" -format:csv -limit:2 -ignoreFirst:true -cr:10.0 -dontWait:true
48
48
```
49
49
50
50
* The recommended method is for `LightIngest` to work with the ingestion endpoint at `https://ingest-{yourClusterNameAndRegion}.kusto.windows.net`. This way, the Azure Data Explorer service can manage the ingestion load, and you can easily recover from transient errors. However, you can also configure `LightIngest` to work directly with the engine endpoint (`https://{yourClusterNameAndRegion}.kusto.windows.net`).
@@ -58,48 +58,67 @@ The utility can pull source data from a local folder or from an Azure blob stora
58
58
|-database |-db |string |Optional |Target Azure Data Explorer database name |
59
59
|-table | |string |Mandatory |Target Azure Data Explorer table name |
60
60
|-sourcePath |-source |string |Mandatory |Path to source files or root URI of the blob container. If the data is in blobs, must contain storage account key or SAS. Recommended to enclose in double quotes |
61
-
|-prefix | |string |Optional |When the source data to ingest resides on blob storage, this URL prefix is shared by all blobs, excluding the container name. For example, if the data is in `MyContainer/Dir1/Dir2`, then the prefix should be `Dir1/Dir2`. Enclosing in double quotes is recommended |
61
+
|-prefix | |string |Optional |When the source data to ingest resides on blob storage, this URL prefix is shared by all blobs, excluding the container name. <br>For example, if the data is in `MyContainer/Dir1/Dir2`, then the prefix should be `Dir1/Dir2`. Enclosing in double quotes is recommended |
62
62
|-pattern | |string |Optional |Pattern by which source files/blobs are picked. Supports wildcards. For example, `"*.csv"`. Recommended to enclose in double quotes |
63
+
|-zipPattern | |string |Optional |Regular expression to use when selecting which files in a ZIP archive to ingest.<br>All other files in the archive will be ignored.For example, `"*.csv"`. It's recommended to surround it in double quotes |
63
64
|-format |-f |string |Optional |Source data format. Must be one of the [supported formats](https://docs.microsoft.com/azure/kusto/management/data-ingestion/#supported-data-formats) |
64
65
|-ingestionMappingPath |-mappingPath |string |Optional |Path to ingestion column-mapping file (mandatory for Json and Avro formats). See [data mappings](https://docs.microsoft.com/azure/kusto/management/mappings) |
65
66
|-ingestionMappingRef |-mappingRef |string |Optional |Name of a pre-created ingestion column mapping (mandatory for Json and Avro formats). See [data mappings](https://docs.microsoft.com/azure/kusto/management/mappings) |
67
+
|-creationTimePattern | |string |Optional |When set, is used to extract the CreationTime property from the file or blob path. See [Using CreationTimePattern argument](#using-creationtimepattern-argument) |
66
68
|-ignoreFirstRow |-ignoreFirst |bool |Optional |If set, the first record of each file/blob is ignored (for example, if the source data has headers) |
67
69
|-tag | |string |Optional |[Tags](https://docs.microsoft.com/azure/kusto/management/extents-overview#extent-tagging) to associate with the ingested data. Multiple occurrences are permitted |
68
70
|-dontWait | |bool |Optional |If set to 'true', does not wait for ingestion completion. Useful when ingesting large amounts of files/blobs |
69
71
72
+
### Using CreationTimePattern argument
73
+
74
+
The `-creationTimePattern` argument extracts the CreationTime property from the file or blob path. The pattern does not need to reflect the entire item path, just the section enclosing the timestamp you want to use.
75
+
The value of the argument must contain of three sections:
76
+
* Constant test immediately preceding the timestamp, enclosed in single quotes
77
+
* The timestamp format, in standard [.NET DateTime notation](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings)
78
+
* Constant text immediately following the timestamp
79
+
For example, if blob names end with 'historicalvalues19840101.parquet' (the timestamp is four digits for the year, two digits for the month and two digits for the day of month), the corresponding value for the `-creationTimePattern` argument is 'historicalvalues'yyyyMMdd'.parquet'.
80
+
70
81
### Command-line arguments for advanced scenarios
71
82
72
83
|Argument name |Short name |Type |Mandatory |Description |
|-compression |-cr |double |Optional |Compression ratio hint. Useful when ingesting compressed files/blobs to help Azure Data Explorer assess the raw data size. Calculated as original size divided by compressed size |
75
86
|-limit |-l |integer |Optional |If set, limits the ingestion to first N files |
87
+
|-listOnly |-list |bool |Optional |If set, only displays the items that would have been selected for ingestion|
76
88
|-ingestTimeout | |integer |Optional |Timeout in minutes for all ingest operations completion. Defaults to `60`|
|-dataBatchSize | |integer |Optional |Sets the total size limit (MB, uncompressed) of each ingest operation |
79
91
|-filesInBatch | |integer |Optional |Sets the file/blob count limit of each ingest operation |
80
92
|-devTracing |-trace |string |Optional |If set, diagnostic logs are written to a local directory (by default, `RollingLogs` in the current directory, or can be modified by setting the switch value) |
81
93
94
+
## Blob metadata properties
95
+
When used with Azure blobs, `LightIngest` will use certain blob metadata properties to augment the ingestion process.
|`rawSizeBytes`, `kustoUncompressedSizeBytes` | If set, will be interpreted as the uncompressed data size |
99
+
|`kustoCreationTime`, `kustoCreationTimeUtc` | Interpreted as UTC timestamp. If set, will be used to override the creation time in Kusto. Useful for backfilling scenarios |
100
+
82
101
## Usage examples
83
102
84
-
**Ingesting a specific number of blobs in JSON format**
103
+
### Ingesting a specific number of blobs in JSON format
85
104
86
-
* Ingest two blobs under a specified storage account {Account}, files of `JSON` format matching the pattern `.json`
105
+
* Ingest two blobs under a specified storage account {Account}, in `JSON` format matching the pattern `.json`
87
106
* Destination is the database {Database}, the table `SampleData`
88
-
* Data will be ingested at a compression ratio of 10.0
107
+
* Indicate that your data is compressed with the approximate ratio of 10.0
89
108
* LightIngest won't wait for the ingestion to be completed
90
109
91
110
To use the LightIngest command below:
92
111
1. Create a table command and enter the table name into the LightIngest command, replacing `SampleData`.
93
112
1. Create a mapping command and enter the IngestionMappingRef command, replacing `SampleData_mapping`.
94
113
1. Copy your cluster name and enter it into the LightIngest command, replacing `{Cluster Name and Region}`.
95
114
1. Enter the database name into the LightIngest command, replacing `{Database}`.
96
-
1. Replace `{Account}` with your account name.
115
+
1. Replace `{Account}` with your account name and replace `{ROOT_CONTAINER}?{SAS token}` with the appropriate information.
97
116
98
117
```
99
118
LightIngest "Data Source=https://{Cluster name and region}kusto.windows.net;AAD Federated Security=True"
|4.0.9.0 |<ul><li>Added `-zipPattern` argument</li><li>Added `-listOnly` argument</li><li>Arguments summary is displayed before run is commenced</li><li>CreationTime is read from blob metadata properties or from blob or file name, according to the `-creationTimePattern` argument</li></ul>|
0 commit comments