| external help file | PowerShellKusto.dll-Help.xml |
|---|---|
| Module Name | PowerShellKusto |
| online version | https://github.com/santisq/PowerShellKusto/blob/main/docs/en-US/Invoke-KustoIngestFromStorage.md |
| schema | 2.0.0 |
Ingests local or blob storage files into Azure Data Explorer.
Invoke-KustoIngestFromStorage
[-Path] <String>
[-Table] <String>
[[-Database] <String>]
[-Mapping <IngestionMapping>]
[-Format <DataSourceFormat>]
[-IgnoreFirstRecord]
[-MaxRetries <Int32>]
[-RetryDelay <TimeSpan>]
[<CommonParameters>]The Invoke-KustoIngestFromStorage cmdlet can be used to ingest local or blob storage files into a table
on your Azure Data Explorer Cluster.
For ingestion from a Stream see Invoke-KustoIngestFromStream.
For more details on Kusto ingestion, checkout Ingest from storage.
Invoke-KustoIngestFromStorage .\myCsvFile.csv -Table myTable -Database myDb -IgnoreFirstRecord$uri = 'https://myStorageAccount.blob.core.windows.net/my-container/myCsvFile.csv?sp=.....'
Invoke-KustoIngestFromStorage $uri -Table myTable -Database myDb -IgnoreFirstRecordThis example demonstrates how you can ingest into myTable directly from a Storage Account
using a SAS Key and URI.
# create a new Json to ingest
Get-Process | Select-Object Id, Name | ConvertTo-Json | Set-Content myJson.json
# create a new table
Invoke-KustoControlCommand '.create table MyJsonTable(Id:int, Name:string)' -Database myDb
# ingest the Json
Invoke-KustoIngestFromStorage .\myJson.json -Table MyJsonTable -Database myDb -Format multijsonNote
This example specifies a format of multijson instead json because a JSON Array is classified as multijson, while JSON Lines adhere to the json format.
See The JSON format for more details.
This non mandatory parameter determines which Database in your Cluster will be targetted by your ingest command.
Note
If not supplied, the Database used will be the one specified when you called Connect-Kusto.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis parameter determines the format of the file to be ingested. The default value is csv.
Type: DataSourceFormat
Parameter Sets: (All)
Aliases:
Accepted values: csv, tsv, scsv, sohsv, psv, txt, raw, tsve, w3clogfile, apacheavro, orc, sstream, parquet, avro, multijson, singlejson, json
Required: False
Position: Named
Default value: csv
Accept pipeline input: False
Accept wildcard characters: FalseThis switch indicates that ingestion should ignore the first record of a file. This property is useful for files in CSV and similar formats, if the first record in the file are the column names.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis optional parameter indicates how to map data from the source file to the actual columns in the table. You can define the format value with the relevant mapping type.
To create a new mapping object, checkout New-KustoIngestionMapping and New-KustoColumnMapping documentations.
See data mappings and Class KustoIngestionProperties for more information.
Type: IngestionMapping
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseDetermines the total retry service calls when there is an ingestion failure. The default retry value is 3.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 3
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the path or URI to the file to ingest.
Type: String
Parameter Sets: (All)
Aliases: Uri
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseDetermines the time to wait before retrying. The default value is 1 second.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [timespan] '00:00:01'
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the database table in your Cluster to ingest into.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters. For more information, see about_CommonParameters.