Home

KQL for devices integrated

%3CLINGO-SUB%20id%3D%22lingo-sub-1147489%22%20slang%3D%22en-US%22%3EKQL%20for%20devices%20integrated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1147489%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help%20with%20a%20query%20(KQL)%20in%20order%20to%20collect%20all%20the%20devices%20list%20(from%20where%20our%20Log%20Analytics%2C%20Sentinel%20is%20collecting%20logs).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20Advance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EMitesh%20Agrawal%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1147489%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%20Language%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1148005%22%20slang%3D%22en-US%22%3ERe%3A%20KQL%20for%20devices%20integrated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1148005%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F539205%22%20target%3D%22_blank%22%3E%40MiteshAgrawal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20do%20you%20mean%20by%20devices%20and%20which%20logs%20are%20you%20collecting%3F%26nbsp%3B%20This%20example%20could%20get%20all%20the%20unique%20Computer%20names%20in%20the%20%3CSTRONG%3EHeartbeat%3C%2FSTRONG%3E%20Table.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fms.portal.azure.com%23%4072f988bf-86f1-41af-91ab-2d7cd011db47%2Fblade%2FMicrosoft_Azure_Monitoring_Logs%2FDemoLogsBlade%2FresourceId%2F%252FDemo%2Fsource%2FLogsBlade.AnalyticsShareLinkToQuery%2Fq%2FH4sIAAAAAAAAA%25252FNITSwqSUpNLOHlqlFIySwuycxLLlFwzs8tKC1JLQIJFpfm5iYWZValKiTnl%25252BaVaMDkNHm5ALAbcD89AAAA%2Ftimespan%2FP1D%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGo%20to%20Log%20Analytics%20and%20run%20query%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%0A%3CTABLE%20cellspacing%3D%221%22%20cellpadding%3D%225%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTH%3Ecount_Computer%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E32%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOr%20from%20All%20Tables%20(I%20filtered%20on%20just%20top%2010%20by%20results)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fms.portal.azure.com%23%4072f988bf-86f1-41af-91ab-2d7cd011db47%2Fblade%2FMicrosoft_Azure_Monitoring_Logs%2FDemoLogsBlade%2FresourceId%2F%252FDemo%2Fsource%2FLogsBlade.AnalyticsShareLinkToQuery%2Fq%2FH4sIAAAAAAAAAyvNy8zPUyjPLMkozi8tSk5VsFUISUzKSfVLzE1V0OLlqlEoLs3NTSzKrEpVSEnOL80r0XDOzy0oLUkt0lRIqkRSDFJbkl%25252BgYGgAEoeojYepVUhJLU7mAgAC0jkWbQAAAA%25253D%25253D%2Ftimespan%2FP1D%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGo%20to%20Log%20Analytics%20and%20run%20query%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%0A%3CTABLE%20cellspacing%3D%221%22%20cellpadding%3D%225%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTH%3ETableName%3C%2FTH%3E%0A%3CTH%3Edcount_Computer%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EOperation%3C%2FTD%3E%0A%3CTD%3E33%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EPerf%3C%2FTD%3E%0A%3CTD%3E33%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EHeartbeat%3C%2FTD%3E%0A%3CTD%3E32%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EInsightsMetrics%3C%2FTD%3E%0A%3CTD%3E32%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EConfigurationData%3C%2FTD%3E%0A%3CTD%3E32%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EUpdate%3C%2FTD%3E%0A%3CTD%3E31%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EProtectionStatus%3C%2FTD%3E%0A%3CTD%3E30%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ESecurityBaseline%3C%2FTD%3E%0A%3CTD%3E25%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ESecurityBaselineSummary%3C%2FTD%3E%0A%3CTD%3E25%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EConfigurationChange%3C%2FTD%3E%0A%3CTD%3E15%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eor%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fms.portal.azure.com%23%4072f988bf-86f1-41af-91ab-2d7cd011db47%2Fblade%2FMicrosoft_Azure_Monitoring_Logs%2FDemoLogsBlade%2FresourceId%2F%252FDemo%2Fsource%2FLogsBlade.AnalyticsShareLinkToQuery%2Fq%2FH4sIAAAAAAAAA03LMQqAMBAF0V7wDr9U72Blb%25252BUFYlzIgpuEZINEPLykEGznMcVz8LhYXQ4lWcKMzewnrUYIU989ODgre6tYgsSilFq8HCUCZx%25252BUJGodPhyb5iJiEt8E7PX3vSPJXjxtAAAA%2Ftimespan%2FP1D%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGo%20to%20Log%20Analytics%20and%20run%20query%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3Eunion%3C%2FSPAN%3E%3CSPAN%3E%20withsource%20%3D%20TableName%20*%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Edistinct%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%20isnotempty%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%20%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3E%20Computer%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1149465%22%20slang%3D%22en-US%22%3ERe%3A%20KQL%20for%20devices%20integrated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1149465%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239477%22%20target%3D%22_blank%22%3E%40Clive%20Watson%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAppreciate%20your%20quick%20reply.%20I%20guess%20my%20requirement%20wasn't%20clear.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20know%20the%20devices%20sending%20logs%20to%20Azure%20Sentinel.%20We%20have%20Windows%20servers%2C%20Syslog%20devices%20(Firewalls%2C%20WAF%2C%20etc.)%2C%20Linux%20servers%2C%20AV%2C%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20know%3A%3C%2FP%3E%3CP%3E1.%20The%20total%20count%20and%20the%20list%20of%20devices%20integrated%20(sending%20or%20configured%20to%20send%20but%20not%20sending%20logs%20-%20log%20stoppage).%3C%2FP%3E%3CP%3E2.%20The%20total%20count%20and%20the%20list%20of%20devices%20sending%20logs%20currently.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1149703%22%20slang%3D%22en-US%22%3ERe%3A%20KQL%20for%20devices%20integrated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1149703%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F539205%22%20target%3D%22_blank%22%3E%40MiteshAgrawal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20Servers%20-%20Windows%20or%20Linux%2C%20use%20this%20but%20please%20adjust%20the%20top%20two%20lines%20to%20suit%20your%20own%20criteria%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Elet%20timeRangeQuery%20%3D%201h%3B%0Alet%20UnhealthyCriteria%20%3D%201m%3B%0AHeartbeat%0A%7C%20where%20TimeGenerated%20%26gt%3B%20startofday(ago(timeRangeQuery))%0A%7C%20summarize%20LastHeartbeat%20%3D%20max(TimeGenerated)%20by%20Computer%2C%20OSType%2C%20OSName%0A%7C%20extend%20State%20%3D%20iff(LastHeartbeat%20%26lt%3B%20ago(UnhealthyCriteria)%2C%20'Unhealthy'%2C%20'Healthy')%0A%7C%20extend%20TimeFromNow%20%3D%20now()%20-%20LastHeartbeat%0A%7C%20extend%20%5B%22TimeAgo%22%5D%20%3D%20strcat(toint(TimeFromNow%20%2F%201s)%2C%20'%20seconds')%0A%7C%20project%20Computer%2C%20State%2C%20TimeAgo%2C%20TimeFromNow%2C%20OSType%0A%7C%20order%20by%20TimeAgo%20desc%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fms.portal.azure.com%23%4072f988bf-86f1-41af-91ab-2d7cd011db47%2Fblade%2FMicrosoft_Azure_Monitoring_Logs%2FDemoLogsBlade%2FresourceId%2F%252FDemo%2Fsource%2FLogsBlade.AnalyticsShareLinkToQuery%2Fq%2FH4sIAAAAAAAAA2WQT2vDMAzF74F8B9FLHcgYPe8PjMLWw%25252BjY2p3GDmqsJB6xHWyFNGMffnaXlYSeLFtPv%25252FfkhhhYaXpDU9FrR26AO1jVN2nShM67qQkbroe1U0xOYWzq0NwQOj4Qcpr8QF%25252BTI9gHyhMZcsgk4R48B4ktJQ4CKyvmJlkWB32nNTr1TfCMns%25252FMYKLxKGbADA4DrK1uu5Ajh5fdfmgpnlvUFFl0ZDISdhzUAaDKUsyhtxBjXGyU5bA8Py7DZTOW2YQaozw6q7e2D2xje5HB1Tz0RP2xiPqHyi4%25252Bg9qzK5AFW2VYTEHXsPLRHTwV1kj%25252F59g6%25252B0UFT3Y9rZTDyMynYf4%25252FIg5aJ8nFXxqFIMkX4%25252FSpTpNfNJARY%25252B0BAAA%25253D%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGo%20to%20Log%20Analytics%20and%20run%20query%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%0A%3CTABLE%20cellspacing%3D%221%22%20cellpadding%3D%225%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTH%3EComputer%3C%2FTH%3E%0A%3CTH%3EState%3C%2FTH%3E%0A%3CTH%3ETimeAgo%3C%2FTH%3E%0A%3CTH%3ETimeFromNow%3C%2FTH%3E%0A%3CTH%3EOSType%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EContosoASCAlert%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E97%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A37.8659845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EContosoSQLSrv1.ContosoRetail.com%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E8%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A08.1359845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-nodepool1-25494468-3%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E7%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A07.0689845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Erancher-node-3%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E69%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A09.4889845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Egangams-kind-k8s-cluster-master%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E69%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A09.0929845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-18945339-1%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E67%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A07.6729845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Ehardening-demo%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E66%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A06.3559845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-14727540-0%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E66%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A06.6129845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EMarketingLinux1%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E65%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A05.2389845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EContosoAppSrv1%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E63%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A03.8259845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ETargetVM%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E60%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A00.0759845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-nodepool1-25494468-4%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E60%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A01%3A00.4929845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-18945339-2%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E59%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A59.9459845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-nodepool1-25494468-2%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E56%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A56.8229845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-14727540-2%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E56%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A56.1859845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Erancher-node-2%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E55%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A55.4159845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-18945339-0%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E54%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A54.2189845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EContosoJbFwJb%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E50%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A50.8689845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Edemo2%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E50%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A50.3389845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Ek8s-master-14134042-0%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E45%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A45.8929845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-nodepool1-42911611-2%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E41%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A41.8159845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EInfraScaleVMs%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E40%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A40.0389845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EAmberIgniteDemo%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E39%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A39.9889845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-14727540-1%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E39%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A39.2529845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-nodepool1-25494468-1%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E36%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A36.5129845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-40719753-2%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E35%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A35.9229845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EContosoWeb1.ContosoRetail.com%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E33%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A33.8189845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Erancher-node-1%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E25%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A25.1429845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Eaks-agentpool-40719753-1%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E22%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A22.6459845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EAmberIgnite1803%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E16%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A00%3A16.5589845%3C%2FTD%3E%0A%3CTD%3EWindows%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Enode-4%3C%2FTD%3E%0A%3CTD%3EUnhealthy%3C%2FTD%3E%0A%3CTD%3E126%20seconds%3C%2FTD%3E%0A%3CTD%3E00%3A02%3A06.1189845%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EContosoAzLnx1%3C%2FTD%3E%0A%3CTD%3EHealthy%3C%2FTD%3E%0A%3CTD%3E-4%20seconds%3C%2FTD%3E%0A%3CTD%3E-00%3A00%3A04.4010155%3C%2FTD%3E%0A%3CTD%3ELinux%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESyslog%20devices%20like%20Firewalls%2C%20maybe%20in%20the%20Syslog%20or%20CommonSecurity%20(CEF)%20tables....more%20later%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1151014%22%20slang%3D%22en-US%22%3ERe%3A%20KQL%20for%20devices%20integrated%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1151014%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F539205%22%20target%3D%22_blank%22%3E%40MiteshAgrawal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20are%20some%20Tables%20for%20the%20other%20data%20sets%20you%20require.%26nbsp%3B%20As%20you%20can%20see%20it%20will%20be%20helpful%20if%20you%20listed%20the%20products%20to%20help%20you%20identify%20the%20Tables%20the%20devices%20%22might%22%20send%20data%20to.%26nbsp%3B%20This%20isn't%20a%20full%20list...you%20will%20need%20to%20check%20your%20own%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%2F%2F%20find%20Azure%20Firewalls%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3EAzureDiagnostics%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BResourceType%26nbsp%3B%3D%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22AZUREFIREWALLS%22%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%2F%2FWindows%20Firewall%3C%2FDIV%3E%0A%3CDIV%3EWindowsFirewall%3CBR%20%2F%3E%7C%20summarize%20count()%20by%20FirewallAction%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2FBarracuda%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3ECGFWFirewallActivity%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2FBarracuda%20WAF%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3ECommonSecurityLog%20%3CBR%20%2F%3E%7C%20where%20DeviceVendor%20%3D%3D%20%22Barracuda%22%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2FCommonSecurityLog%20%3CBR%20%2F%3E%7C%20where%20DeviceVendor%20%3D%3D%20%22Check%20Point%22%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3ECommonSecurityLog%20%3CBR%20%2F%3E%7C%20where%20DeviceVendor%20%3D%3D%20%22Cisco%22%3CBR%20%2F%3E%7C%20where%20DeviceProduct%20%3D%3D%20%22ASA%22%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%3CSPAN%3EHere%20is%20a%20sample%20query%2C%20you%20will%20need%20to%20add%20the%20logic%20from%20the%20Heartbeat%20table%20I%20showed%20before%20(to%20get%20last%20record%20etc...)%2C%20and%20also%20tweak%20each%20line%20to%20match%20what%20ever%20devices%20and%20data%20you%20have.%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Eunion%20isfuzzy%3Dtrue%20withsource%20%3D%20tt%0A(AzureDiagnostics%20%20%20%20%7C%20where%20ResourceType%20%3D%3D%20%22AZUREFIREWALLS%22%20)%2C%20%0A(WindowsFirewall%20%20%20%20%20%7C%20summarize%20count()%20by%20FirewallAction%20)%2C%20%0A(CGFWFirewallActivity%7C%20summarize%20count()%20by%20DeviceName%20%3D%20Computer%20)%2C%0A(CommonSecurityLog%E2%80%8B%20%20%20%7C%20where%20DeviceVendor%20%3D%3D%20%22Barracuda%22%20)%2C%20%0A(CommonSecurityLog%E2%80%8B%20%20%20%7C%20where%20DeviceVendor%20%3D%3D%20%22Palo%20Alto%20Networks%22%20%7C%20where%20isnotempty(DeviceName)%20%7C%20summarize%20count()%20by%20DeviceVendor%2C%20DeviceName)%20%0A%2F%2F%20show%20devices%20found%0A%7C%20summarize%20count()%20by%20%20DeviceName%20%2C%20DeviceVendor%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20only%20have%20Palo%20Alto%20data%20(so%20the%20above%20line%20for%20%22Palo%20Alto%22%20is%20the%20most%20accurate).%20The%20sample%20output%20looks%20like%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F169006i00464583AFB0D9DF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_0.png%22%20title%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hi Everyone,

 

Please help with a query (KQL) in order to collect all the devices list (from where our Log Analytics, Sentinel is collecting logs).

 

Thanks in Advance.

 

Regards,

Mitesh Agrawal

4 Replies
Highlighted

@MiteshAgrawal 

 

What do you mean by devices and which logs are you collecting?  This example could get all the unique Computer names in the Heartbeat Table.  

 

Go to Log Analytics and run query

count_Computer
32

 

Or from All Tables (I filtered on just top 10 by results)

 

Go to Log Analytics and run query

TableName dcount_Computer
Operation 33
Perf 33
Heartbeat 32
InsightsMetrics 32
ConfigurationData 32
Update 31
ProtectionStatus 30
SecurityBaseline 25
SecurityBaselineSummary 25
ConfigurationChange 15

 

or

 

Go to Log Analytics and run query

union withsource = TableName *
| distinct Computer
| where isnotempty(Computer)
| summarize by Computer
 
Highlighted

Hi @Clive Watson,

 

Appreciate your quick reply. I guess my requirement wasn't clear.

 

I want to know the devices sending logs to Azure Sentinel. We have Windows servers, Syslog devices (Firewalls, WAF, etc.), Linux servers, AV, etc.

 

I need to know:

1. The total count and the list of devices integrated (sending or configured to send but not sending logs - log stoppage).

2. The total count and the list of devices sending logs currently.

Highlighted

@MiteshAgrawal 

 

For Servers - Windows or Linux, use this but please adjust the top two lines to suit your own criteria 

let timeRangeQuery = 1h;
let UnhealthyCriteria = 1m;
Heartbeat
| where TimeGenerated > startofday(ago(timeRangeQuery))
| summarize LastHeartbeat = max(TimeGenerated) by Computer, OSType, OSName
| extend State = iff(LastHeartbeat < ago(UnhealthyCriteria), 'Unhealthy', 'Healthy')
| extend TimeFromNow = now() - LastHeartbeat
| extend ["TimeAgo"] = strcat(toint(TimeFromNow / 1s), ' seconds')
| project Computer, State, TimeAgo, TimeFromNow, OSType
| order by TimeAgo desc

 

 

Go to Log Analytics and run query

Computer State TimeAgo TimeFromNow OSType
ContosoASCAlert Unhealthy 97 seconds 00:01:37.8659845 Windows
ContosoSQLSrv1.ContosoRetail.com Healthy 8 seconds 00:00:08.1359845 Windows
aks-nodepool1-25494468-3 Healthy 7 seconds 00:00:07.0689845 Linux
rancher-node-3 Unhealthy 69 seconds 00:01:09.4889845 Linux
gangams-kind-k8s-cluster-master Unhealthy 69 seconds 00:01:09.0929845 Linux
aks-agentpool-18945339-1 Unhealthy 67 seconds 00:01:07.6729845 Linux
hardening-demo Unhealthy 66 seconds 00:01:06.3559845 Linux
aks-agentpool-14727540-0 Unhealthy 66 seconds 00:01:06.6129845 Linux
MarketingLinux1 Unhealthy 65 seconds 00:01:05.2389845 Linux
ContosoAppSrv1 Unhealthy 63 seconds 00:01:03.8259845 Windows
TargetVM Unhealthy 60 seconds 00:01:00.0759845 Windows
aks-nodepool1-25494468-4 Unhealthy 60 seconds 00:01:00.4929845 Linux
aks-agentpool-18945339-2 Healthy 59 seconds 00:00:59.9459845 Linux
aks-nodepool1-25494468-2 Healthy 56 seconds 00:00:56.8229845 Linux
aks-agentpool-14727540-2 Healthy 56 seconds 00:00:56.1859845 Linux
rancher-node-2 Healthy 55 seconds 00:00:55.4159845 Linux
aks-agentpool-18945339-0 Healthy 54 seconds 00:00:54.2189845 Linux
ContosoJbFwJb Healthy 50 seconds 00:00:50.8689845 Windows
demo2 Healthy 50 seconds 00:00:50.3389845 Linux
k8s-master-14134042-0 Healthy 45 seconds 00:00:45.8929845 Linux
aks-nodepool1-42911611-2 Healthy 41 seconds 00:00:41.8159845 Linux
InfraScaleVMs Healthy 40 seconds 00:00:40.0389845 Linux
AmberIgniteDemo Healthy 39 seconds 00:00:39.9889845 Windows
aks-agentpool-14727540-1 Healthy 39 seconds 00:00:39.2529845 Linux
aks-nodepool1-25494468-1 Healthy 36 seconds 00:00:36.5129845 Linux
aks-agentpool-40719753-2 Healthy 35 seconds 00:00:35.9229845 Linux
ContosoWeb1.ContosoRetail.com Healthy 33 seconds 00:00:33.8189845 Windows
rancher-node-1 Healthy 25 seconds 00:00:25.1429845 Linux
aks-agentpool-40719753-1 Healthy 22 seconds 00:00:22.6459845 Linux
AmberIgnite1803 Healthy 16 seconds 00:00:16.5589845 Windows
node-4 Unhealthy 126 seconds 00:02:06.1189845 Linux
ContosoAzLnx1 Healthy -4 seconds -00:00:04.4010155 Linux

 

 

Syslog devices like Firewalls, maybe in the Syslog or CommonSecurity (CEF) tables....more later  

Highlighted

@MiteshAgrawal 

 

Here are some Tables for the other data sets you require.  As you can see it will be helpful if you listed the products to help you identify the Tables the devices "might" send data to.  This isn't a full list...you will need to check your own data.

 

// find Azure Firewalls 

AzureDiagnostics 
where ResourceType == "AZUREFIREWALLS" 
 
//Windows Firewall
WindowsFirewall
| summarize count() by FirewallAction
 
//Barracuda
CGFWFirewallActivity
 
//Barracuda WAF 
CommonSecurityLog​
| where DeviceVendor == "Barracuda"
 
//CommonSecurityLog​
| where DeviceVendor == "Check Point"
 
CommonSecurityLog​
| where DeviceVendor == "Cisco"
| where DeviceProduct == "ASA"
 
Here is a sample query, you will need to add the logic from the Heartbeat table I showed before (to get last record etc...), and also tweak each line to match what ever devices and data you have.


union isfuzzy=true withsource = tt
(AzureDiagnostics    | where ResourceType == "AZUREFIREWALLS" ), 
(WindowsFirewall     | summarize count() by FirewallAction ), 
(CGFWFirewallActivity| summarize count() by DeviceName = Computer ),
(CommonSecurityLog​   | where DeviceVendor == "Barracuda" ), 
(CommonSecurityLog​   | where DeviceVendor == "Palo Alto Networks" | where isnotempty(DeviceName) | summarize count() by DeviceVendor, DeviceName) 
// show devices found
| summarize count() by  DeviceName , DeviceVendor 

 

I only have Palo Alto data (so the above line for "Palo Alto" is the most accurate). The sample output looks like

 

clipboard_image_0.png