external help file | Module Name | online version | schema |
---|---|---|---|
PowerShellKusto.dll-Help.xml |
PowerShellKusto |
2.0.0 |
Invokes a KQL or T-SQL query over an Azure Data Explorer Cluster.
Invoke-KustoQuery
[-Query] <String>
[[-Database] <String>]
[-OutputType <OutputType>]
[-RequestProperties <ClientRequestProperties>]
[<CommonParameters>]
The Invoke-KustoQuery
cmdlet allows you to run
Kusto Query Language (KQL) queries or
T-SQL queries on a
specified Database of your Azure Data Explorer Cluster.
Invoke-KustoQuery 'search * | summarize count() by $table'
This examples shows how to get the log count summarized by each table.
Tip
In this example, the database is specified by the database used when you called Connect-Kusto
.
Invoke-KustoQuery 'myTable | take 10' -Database myDb
$requestProps = New-KustoClientRequestProperties -NoTruncation -ServerTimeout '00:05:00'
Invoke-KustoQuery 'myTable | project fooProp, barProp' -RequestProperties $requestProps
This example demonstrates how you can specify request properties for your query.
See also New-KustoClientRequestProperties
for more details.
- In this case
-NoTruncation
is particularly useful to overcome the 500k row limit on your query. -ServerTimeout '00:05:00'
allows the query to run for at least 5 minutes before timing out.
This non mandatory parameter determines which Database in your Cluster will be targetted by your query 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: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Determines the output type this cmdlet will produce. The default value is PSObject
.
Type: OutputType
Parameter Sets: (All)
Aliases:
Accepted values: PSObject, Json, Csv, DataTable, Html
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The KQL or T-SQL query you want to run against a specified Database in your Cluster.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Request properties control how a query or command executes and returns results. If no ClientRequestProperties
object is supplied this cmdlet will use default properties.
Note
You can create new request properties using New-KustoClientRequestProperties.
Type: ClientRequestProperties
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters. For more information, see about_CommonParameters.
The output type from this cmdlet is determined by the -OutputType
parameter.
By default, this cmdlet outputs PSObject
.