Created
May 27, 2021 06:55
-
-
Save alexverboon/e3124704b65aeda47ef98e551bd6cb43 to your computer and use it in GitHub Desktop.
Enrich DeviceNetworkEvents with the port number Service name information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enrich DeviceNetworkEvents with the port number Servicename information | |
let iana_port_assignments = (externaldata(entry: string ) [@"https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv"] | |
with (format="txt",ignoreFirstRecord=true)) | |
//iana_port_assignments | |
// Service Name,Port Number,Transport Protocol,Description,Assignee,Contact,Registration Date,Modification Date,Reference,Service Code,Unauthorized Use Reported,Assignment Notes | |
| extend data = parse_csv(entry) | |
| extend ServiceName = tostring(data[0]) | |
| extend PortNumber = toint(data[1]) | |
| project ServiceName, PortNumber | |
| summarize any(ServiceName) by PortNumber | |
| extend ServiceName = any_ServiceName; | |
iana_port_assignments | |
| join kind=rightouter (DeviceNetworkEvents | |
// | where DeviceName contains "DESKTOP-1234" | |
) | |
on $left. PortNumber == $right.RemotePort | |
| project-away any_ServiceName | |
| summarize EventCount=count() by PortNumber, ServiceName | |
| sort by PortNumber asc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment