Categorieën
Project

KQL – Project

Project allows you to select a subset of columns

//adds a calculated column to the result set
Perf
| where CounterName == "Free Megabytes"
|extend FreeGB = CounterValue / 1000

Perf
| project ObjectName
, CounterName
, InstanceName
, CounterValue
, TimeGenerated

//Combine project with extend
Perf
| where CounterName == "Free Megabytes"
| project ObjectName
, CounterName
, InstanceName
, CounterValue
, TimeGenerated
| extend FreeGB = CounterValue / 1000
, FreeMB = CounterValue
,FreeKB = CounterValue * 1000

//Combine project with extend
Perf
| where CounterName == "Free Megabytes"
| project ObjectName
, CounterName
, InstanceName
, CounterValue
, TimeGenerated
| extend FreeGB = CounterValue / 1000
, FreeMB = CounterValue
,FreeKB = CounterValue * 1000

//Hide the CounterValue column in the results
Perf
| where CounterName == "Free Megabytes"
| extend FreeGB = CounterValue / 1000
, FreeMB = CounterValue
,FreeKB = CounterValue * 1000
| project ObjectName
, CounterName
, InstanceName
, TimeGenerated

//Use project to build extend columns directly
Perf
| where CounterName == "Free Megabytes"
| project ObjectName
, CounterName
, InstanceName
, CounterValue
, TimeGenerated
, FreeGB = CounterValue / 1000
, FreeMB = CounterValue
, FreeKB = CounterValue * 1000

//remove columns from result set
Perf
| where TimeGenerated > ago(1h)
| project-away CounterValue
, SourceSystem
, CounterPath
, MG

//Renaming a column
Perf
| where TimeGenerated > ago(1h)
| project-rename myRenamedComputer = Computer

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit /  Bijwerken )

Google photo

Je reageert onder je Google account. Log uit /  Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit /  Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit /  Bijwerken )

Verbinden met %s

Deze site gebruikt Akismet om spam te bestrijden. Ontdek hoe de data van je reactie verwerkt wordt.