SOLVED

Include workspace name in query output

%3CLINGO-SUB%20id%3D%22lingo-sub-334840%22%20slang%3D%22en-US%22%3EInclude%20workspace%20name%20in%20query%20output%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-334840%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20systematically%20collect%20the%20workspace%20name%20and%20include%20it%20in%20the%20output%20of%20a%20log%20analytics%20query%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20working%20on%20an%20event%20management%20project%20and%20the%20json%20output%20includes%20the%20workspaceID%20but%20not%20the%20name.%26nbsp%3B%20Our%20CMDB%20currently%20doesn't%20populate%20the%20workspaceID.%20I%20am%20looking%20for%20a%20way%20to%20map%20the%20triggered%20alerts%20to%20a%20support%20group%20without%20having%20to%20hardcode%20mappings.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20hoping%20I%20could%20use%20something%20like%20extend%20WS%20%3D%20workspace('uid').Name%20to%20add%20this%20data%20in.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-334840%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECustom%20Logs%20and%20Custom%20Fields%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%20Language%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-352784%22%20slang%3D%22en-US%22%3ERe%3A%20Include%20workspace%20name%20in%20query%20output%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-352784%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%2C%20for%20confirming.%20Looks%20like%20we%20are%20going%20to%20be%20modifying%20our%20servicenow%20discovery%20to%20include%20workspaceID%20so%20we%20have%20some%20way%20to%20correlate%20these%20events%20to%20an%20object%20in%20our%20CMDB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-338281%22%20slang%3D%22en-US%22%3ERe%3A%20Include%20workspace%20name%20in%20query%20output%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-338281%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EThere%20is%20no%20such%20option%20available%20as%20far%20as%20I%20know.%20If%20you%20manage%20your%20configuration%20as%20code%20you%20can%20potentially%20when%20deploying%20every%20query%2Falert%20that%20you%20have%20to%20put%20statically%20the%20name%20of%20the%20workspace%20with%20something%20like%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%7C%20extend%20workspaceName%20%3D%20'Workspace1'%3C%2FPRE%3E%0A%3CP%3EMark%20this%20reply%20as%20answer%20if%20it%20provides%20some%20answer%20to%20your%20question.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Is there a way to systematically collect the workspace name and include it in the output of a log analytics query?

 

We are working on an event management project and the json output includes the workspaceID but not the name.  Our CMDB currently doesn't populate the workspaceID. I am looking for a way to map the triggered alerts to a support group without having to hardcode mappings.  

 

I was hoping I could use something like extend WS = workspace('uid').Name to add this data in.

2 Replies
best response confirmed by StephenMorrison (Occasional Contributor)
Solution

Hi,

There is no such option available as far as I know. If you manage your configuration as code you can potentially when deploying every query/alert that you have to put statically the name of the workspace with something like

 

| extend workspaceName = 'Workspace1'

Mark this reply as answer if it provides some answer to your question.

Thanks, for confirming. Looks like we are going to be modifying our servicenow discovery to include workspaceID so we have some way to correlate these events to an object in our CMDB