project / project-away / project-rename
project decides which columns the result has. List the columns you want, in the order you want them;
every other column is dropped.
SigninLogs
| project TimeGenerated, UserPrincipalName, IPAddress
Inside project you can also rename a column (User = UserPrincipalName) or compute a new one
(Domain = tolower(Location)). This makes it the usual last step of a query: it shapes the output
that a person will read.
Two related operators save typing:
project-awaydrops the columns you list and keeps all the others. Useful on wide tables when you only want to hide a few noisy columns.project-renamerenames columns (New = Old) and keeps everything else, in the same order.
project or extend? extend adds a computed column and keeps all existing ones.
project keeps only what you list. If you find yourself writing extend followed by a long project,
a single project with the computed column is often enough.
Things to know
- Column names are case-sensitive:
project ipaddressfails when the column isIPAddress. projectearly in a query does not make it faster in the waywheredoes; its main job is a readable result.- On this site, wildcards such as
project-away Device*are not supported yet.
Examples
DeviceNetworkEvents
| where RemotePort == 389
| project TimeGenerated, DeviceName, Server = RemoteIP, Url = tolower(RemoteUrl)Server = RemoteIP renames a column; Url = tolower(RemoteUrl) computes a new one. Columns you don't list are gone.
SecurityEvent
| where EventID == 4672
| project-away Activity, TargetDomainName, Status, SubStatus, LogonProcessName, WorkstationNameDeviceNetworkEvents
| where RemotePort == 80
| project-rename Device = DeviceName, Process = InitiatingProcessFileNamePractice it
- #05Complete the query: did the password spray work?easy
- #09Did the brute force succeed?easy
- #11Catch an Office document starting a shelleasy
- #12Complete the query: find encoded PowerShell (has vs contains)medium
- #13What did the attacker run to look around?easy
+ 14 in the full SC-200 set · all exercises