Skip to content

Commit 6433979

Browse files
committed
Added content from Vladik + Ornat + updated image
1 parent 43726bb commit 6433979

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

articles/data-explorer/lightingest.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The utility can pull source data from a local folder or from an Azure blob stora
4444

4545
For example:
4646
```
47-
LightIngest "Data Source=https://ingest-tzgitlin.westus.kusto.windows.net;AAD Federated Security=True" -db:TzviaTest -table:Trips -source:"https://tzgitlinegdemo2.blob.core.windows.net/saadxworkshop1;VXPnUFzvBRLBIqEgcA0hRnSXmq69jVyZMChgUn5BeVwhjLnx4ucHZ8RPGTZ0F2hXHnC/vesoFSMF5f4gepeTJw==" -pattern:"*.csv.gz" -format:csv -limit:2 -ignoreFirst:true -cr:10.0 -dontWait:true
47+
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
4848
```
4949
5050
* 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
5858
|-database |-db |string |Optional |Target Azure Data Explorer database name |
5959
|-table | |string |Mandatory |Target Azure Data Explorer table name |
6060
|-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 |
6262
|-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 |
6364
|-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) |
6465
|-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) |
6566
|-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) |
6668
|-ignoreFirstRow |-ignoreFirst |bool |Optional |If set, the first record of each file/blob is ignored (for example, if the source data has headers) |
6769
|-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 |
6870
|-dontWait | |bool |Optional |If set to 'true', does not wait for ingestion completion. Useful when ingesting large amounts of files/blobs |
6971
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+
7081
### Command-line arguments for advanced scenarios
7182
7283
|Argument name |Short name |Type |Mandatory |Description |
7384
|----------------------|-------------|--------|----------|-------------------------------------------|
7485
|-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 |
7586
|-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|
7688
|-ingestTimeout | |integer |Optional |Timeout in minutes for all ingest operations completion. Defaults to `60`|
7789
|-forceSync | |bool |Optional |If set, forces synchronous ingestion. Defaults to `false` |
7890
|-dataBatchSize | |integer |Optional |Sets the total size limit (MB, uncompressed) of each ingest operation |
7991
|-filesInBatch | |integer |Optional |Sets the file/blob count limit of each ingest operation |
8092
|-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) |
8193
94+
## Blob metadata properties
95+
When used with Azure blobs, `LightIngest` will use certain blob metadata properties to augment the ingestion process.
96+
|Metadata property | Usage |
97+
|---------------------------------------------|---------------------------------------------------------------------------------|
98+
|`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+
82101
## Usage examples
83102
84-
**Ingesting a specific number of blobs in JSON format**
103+
### Ingesting a specific number of blobs in JSON format
85104
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`
87106
* 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
89108
* LightIngest won't wait for the ingestion to be completed
90109
91110
To use the LightIngest command below:
92111
1. Create a table command and enter the table name into the LightIngest command, replacing `SampleData`.
93112
1. Create a mapping command and enter the IngestionMappingRef command, replacing `SampleData_mapping`.
94113
1. Copy your cluster name and enter it into the LightIngest command, replacing `{Cluster Name and Region}`.
95114
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.
97116
98117
```
99118
LightIngest "Data Source=https://{Cluster name and region}kusto.windows.net;AAD Federated Security=True"
100119
-db:{Database name}
101120
-table:SampleData
102-
-source:"https://{Account}.blob.core.windows.net/data?sp=rl&st=2020-03-17T14:10:02Z&se=2022-12-31T14:10:00Z&sv=2019-02-02&sr=c&sig=QY6%2B1jAjIBQzkPIatkdDlbr%2FggUyq4gklmt%2FcOUM31Y%3D"
121+
-source:"https://{Account}.blob.core.windows.net/{ROOT_CONTAINER}?{SAS token}"
103122
-IngestionMappingRef:SampleData_mapping
104123
-pattern:"*.json"
105124
-format:JSON
@@ -113,7 +132,7 @@ To use the LightIngest command below:
113132
1. In Azure Data Explorer, open query count.
114133
![Injestion result in Azure Data Explorer](media/lightingest/lightingest-showfailure-count.png)
115134
116-
**Ingesting blobs using a storage account key or a SAS token**
135+
### Ingesting blobs using a storage account key or a SAS token
117136
118137
* Ingest 10 blobs under specified storage account `ACCOUNT`, in folder `DIR`, under container `CONT`, and matching the pattern `*.csv.gz`
119138
* Destination is database `DB`, table `TABLE`, and the ingestion mapping `MAPPING` is precreated on the destination
@@ -141,7 +160,7 @@ LightIngest.exe "https://ingest-{clusterAndRegion}.kusto.windows.net;Fed=True;In
141160
-limit:10
142161
```
143162
144-
**Ingesting all blobs in a container, not including header rows**
163+
### Ingesting all blobs in a container, not including header rows
145164
146165
* Ingest all blobs under specified storage account `ACCOUNT`, in folder `DIR1/DIR2`, under container `CONT`, and matching the pattern `*.csv.gz`
147166
* Destination is database `DB`, table `TABLE`, and the ingestion mapping `MAPPING` is precreated on the destination
@@ -160,7 +179,7 @@ LightIngest.exe "https://ingest-{clusterAndRegion}.kusto.windows.net;Fed=True"
160179
-ignoreFirstRow:true
161180
```
162181
163-
**Ingesting all JSON files from a path**
182+
### Ingesting all JSON files from a path
164183
165184
* Ingest all files under path `PATH`, matching the pattern `*.json`
166185
* Destination is database `DB`, table `TABLE`, and the ingestion mapping is defined in local file `MAPPING_FILE_PATH`
@@ -176,7 +195,7 @@ LightIngest.exe "https://ingest-{clusterAndRegion}.kusto.windows.net;Fed=True"
176195
-mappingPath:"MAPPING_FILE_PATH"
177196
```
178197
179-
**Ingesting files and writing diagnostic trace files**
198+
### Ingesting files and writing diagnostic trace files
180199
181200
* Ingest all files under path `PATH`, matching the pattern `*.json`
182201
* Destination is database `DB`, table `TABLE`, and the ingestion mapping is defined in local file `MAPPING_FILE_PATH`
@@ -193,3 +212,7 @@ LightIngest.exe "https://ingest-{clusterAndRegion}.kusto.windows.net;Fed=True"
193212
-mappingPath:"MAPPING_FILE_PATH"
194213
-trace:"LOGS_PATH"
195214
```
215+
## Changelog
216+
|Version |Changes |
217+
|---------------|------------------------------------------------------------------------------------|
218+
|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>|
17 KB
Loading

0 commit comments

Comments
 (0)