Forum Discussion
ScottAllison
Feb 27, 2019Iron Contributor
Identify workspace after a Union
I'm executing a query with a union on the Heartbeat table of two work spaces. I'd like to have an additional column that identifies which work space the result is from. The query: union isfuzzy...
- Feb 28, 2019
You can use, withsource, you might need to trim/parse the returned name as its in the format?
workspace : workspace('workspacea').Heartbeat
union withsource = workspace isfuzzy= trueworkspace("a").Heartbeat,workspace("b").Heartbeat| project TimeGenerated , Computer, ResourceId , OSType, workspace| where TimeGenerated < now()| where ResourceId == ""| where OSType == "Windows" or OSType == "Linux"| summarize arg_max(TimeGenerated, *) by Computer, workspace| distinct Computer, workspace
CliveWatson
Microsoft
Feb 28, 2019You can use, withsource, you might need to trim/parse the returned name as its in the format?
workspace : workspace('workspacea').Heartbeat
union withsource = workspace isfuzzy= true
workspace("a").Heartbeat,
workspace("b").Heartbeat
| project TimeGenerated , Computer, ResourceId , OSType, workspace
| where TimeGenerated < now()
| where ResourceId == ""
| where OSType == "Windows" or OSType == "Linux"
| summarize arg_max(TimeGenerated, *) by Computer, workspace
| distinct Computer, workspace
- ScottAllisonMar 05, 2019Iron Contributor
Forgot about "withsource"--that did the trick. Thanks!! :)