Skip to content

Commit 7e681ee

Browse files
committed
done ingestfromstream doc
1 parent 3a92da2 commit 7e681ee

File tree

2 files changed

+51
-35
lines changed

2 files changed

+51
-35
lines changed

docs/en-US/Invoke-KustoIngestFromStorage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Accept wildcard characters: False
146146

147147
### -MaxRetries
148148

149-
Determines the total retry service calls when there is an ingestion failure.
149+
Determines the total retry service calls when there is an ingestion failure. __The default retry value is 3__.
150150

151151
```yaml
152152
Type: Int32
@@ -178,7 +178,7 @@ Accept wildcard characters: False
178178

179179
### -RetryDelay
180180

181-
Determines the time to wait before retrying. The default value is __1 second__.
181+
Determines the time to wait before retrying. __The default value is 1 second__.
182182

183183
```yaml
184184
Type: TimeSpan

docs/en-US/Invoke-KustoIngestFromStream.md

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
{{ Fill in the Synopsis }}
12+
Ingests stream into Azure Data Explorer.
1313

1414
## SYNTAX
1515

@@ -29,23 +29,39 @@ Invoke-KustoIngestFromStream
2929

3030
## DESCRIPTION
3131

32-
{{ Fill in the Description }}
32+
Similar to [`Invoke-KustoIngestFromStorage`](Invoke-KustoIngestFromStorage.md), the `Invoke-KustoIngestFromStream` allows you to ingest data into a table on your Azure Data Explorer Cluster, the only difference is the source being a
33+
[__Stream__](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream) instead of a path or URI.
3334

3435
## EXAMPLES
3536

36-
### Example 1
37+
### Example 1: Ingest from a Memory Stream
3738

3839
```powershell
39-
PS C:\> {{ Add example code here }}
40+
$req = Invoke-WebRequest 'https://myStorageAccount.blob.core.windows.net/....'
41+
Invoke-KustoIngestFromStream $req.RawContentStream -Table myTable -Database myDb
4042
```
4143

42-
{{ Add example description here }}
44+
### Example 2: Ingest from a File Stream
45+
46+
```powershell
47+
$fs = (Get-Item .\myJsonFile.json).OpenRead()
48+
Invoke-KustoIngestFromStream $fs -Table myTable -Database myDb -Format multijson
49+
```
50+
51+
> [!NOTE]
52+
>
53+
> 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.
54+
> See [__The JSON format__](https://learn.microsoft.com/en-us/azure/data-explorer/ingest-json-formats?tabs=kusto-query-language#the-json-format) for more details.
4355
4456
## PARAMETERS
4557

4658
### -Database
4759

48-
{{ Fill Database Description }}
60+
This non mandatory parameter determines which Database in your Cluster will be targetted by your ingest command.
61+
62+
> [!NOTE]
63+
>
64+
> If not supplied, the Database used will be the one specified when you called [`Connect-Kusto`](Connect-Kusto.md).
4965
5066
```yaml
5167
Type: String
@@ -61,7 +77,7 @@ Accept wildcard characters: False
6177
6278
### -Format
6379
64-
{{ Fill Format Description }}
80+
This parameter determines the format of the file to be ingested. The default value is __`csv`__.
6581

6682
```yaml
6783
Type: DataSourceFormat
@@ -71,14 +87,16 @@ Accepted values: csv, tsv, scsv, sohsv, psv, txt, raw, tsve, w3clogfile, apachea
7187
7288
Required: False
7389
Position: Named
74-
Default value: None
90+
Default value: csv
7591
Accept pipeline input: False
7692
Accept wildcard characters: False
7793
```
7894

7995
### -IgnoreFirstRecord
8096

81-
{{ Fill IgnoreFirstRecord Description }}
97+
This switch indicates that ingestion should ignore the first record of a file.
98+
This property is useful for files in `CSV` and similar formats,
99+
if the first record in the file are the column names.
82100

83101
```yaml
84102
Type: SwitchParameter
@@ -94,7 +112,7 @@ Accept wildcard characters: False
94112

95113
### -LeaveOpen
96114

97-
{{ Fill LeaveOpen Description }}
115+
This switch specifies that the cmdlet should not dispose the Stream after ingestion.
98116

99117
```yaml
100118
Type: SwitchParameter
@@ -110,7 +128,12 @@ Accept wildcard characters: False
110128

111129
### -Mapping
112130

113-
{{ Fill Mapping Description }}
131+
This optional parameter indicates how to map data from the source file to the actual columns in the table.
132+
You can define the format value with the relevant mapping type.
133+
134+
To create a new mapping object, checkout [`New-KustoIngestionMapping`](New-KustoIngestionMapping.md) and [`New-KustoColumnMapping`](New-KustoColumnMapping.md) documentations.
135+
136+
See [__data mappings__](https://learn.microsoft.com/en-us/kusto/management/mappings?view=microsoft-fabric) and [__Class `KustoIngestionProperties`__](https://learn.microsoft.com/en-us/kusto/api/netfx/kusto-ingest-client-reference?view=microsoft-fabric#class-kustoingestionproperties) for more information.
114137

115138
```yaml
116139
Type: IngestionMapping
@@ -126,7 +149,7 @@ Accept wildcard characters: False
126149

127150
### -MaxRetries
128151

129-
{{ Fill MaxRetries Description }}
152+
Determines the total retry service calls when there is an ingestion failure. __The default retry value is 3__.
130153

131154
```yaml
132155
Type: Int32
@@ -142,7 +165,7 @@ Accept wildcard characters: False
142165

143166
### -RetryDelay
144167

145-
{{ Fill RetryDelay Description }}
168+
Determines the time to wait before retrying. __The default value is 1 second__.
146169

147170
```yaml
148171
Type: TimeSpan
@@ -151,14 +174,14 @@ Aliases:
151174
152175
Required: False
153176
Position: Named
154-
Default value: None
177+
Default value: [timespan] '00:00:01'
155178
Accept pipeline input: False
156179
Accept wildcard characters: False
157180
```
158181

159182
### -Stream
160183

161-
{{ Fill Stream Description }}
184+
Specifies the Stream object to be ingested.
162185

163186
```yaml
164187
Type: Stream
@@ -174,7 +197,7 @@ Accept wildcard characters: False
174197

175198
### -Table
176199

177-
{{ Fill Table Description }}
200+
Specifies the database table in your Cluster to ingest into.
178201

179202
```yaml
180203
Type: String
@@ -188,25 +211,10 @@ Accept pipeline input: False
188211
Accept wildcard characters: False
189212
```
190213

191-
### -ProgressAction
192-
193-
{{ Fill ProgressAction Description }}
194-
195-
```yaml
196-
Type: ActionPreference
197-
Parameter Sets: (All)
198-
Aliases: proga
199-
200-
Required: False
201-
Position: Named
202-
Default value: None
203-
Accept pipeline input: False
204-
Accept wildcard characters: False
205-
```
206-
207214
### CommonParameters
208215

209-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
216+
This cmdlet supports the common parameters.
217+
For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
210218

211219
## INPUTS
212220

@@ -219,3 +227,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
219227
## NOTES
220228

221229
## RELATED LINKS
230+
231+
[__Ingest from storage__](https://learn.microsoft.com/en-us/kusto/management/data-ingestion/ingest-from-storage?view=microsoft-fabric)
232+
233+
[__Data mappings__](https://learn.microsoft.com/en-us/kusto/management/mappings?view=microsoft-fabric)
234+
235+
[__The JSON format__](https://learn.microsoft.com/en-us/azure/data-explorer/ingest-json-formats?tabs=kusto-query-language#the-json-format)
236+
237+
[__Stream__](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream)

0 commit comments

Comments
 (0)