-1

I want to track a guid value in LogAnalytics, using tracked properties, but I can't get it to be saved as a string (that is with suffix "_s" instead of "_g" for guid). I've tried to convert it to string and to replace all the hyphens to empty string, but no luck. It works fine if I concat the guid with another character, but I want to save the guid as it is of course.

Example, this does not work:

trackedProperties": {
"MessageId": "@{string(Outputs('MyAction').MessageId)}"
}

Anyone got an idea of how to solve this?

TobiasJ
  • 111
  • 1
  • 7
  • Hi Tobias, could you please share some more details of your logic ? Such as the screenshots of your logic app actions and their details. – Hury Shen Feb 26 '20 at 01:35
  • Hi, sure. In the code snippet above the value of "Outputs('MyAction') is a guid. I try to convert it to string by using the string() expression but it is saved in the field "trackedPropertes_MessageId_g" in LogAnalytics, not as "trackedPropertes_MessageId_s". – TobiasJ Feb 26 '20 at 09:36

2 Answers2

1

I think we need to refer to the official document to know the record type and properties.

enter image description here

So could you please check if the "messageId_g" is existed. And if still can't solve it, you can try to use another "Initialize variable" action and put your messageId in it and then tracked the property in "Initialize variable" action, it should be "_s".

Hope it helps~

Hury Shen
  • 14,948
  • 1
  • 9
  • 18
  • In LogAnalytics "trackedProperties_MessageId_g" exists, so the values is stored as a guid. I tried initializing a variable (string) and store the guid in the variable and track the value of this variable. Unfortunately this is stored as a guid ("trackedProperties_MessageId_g") in LogAnalytics. To bypass this issue I've adapted the logic reading the value so that it reads both "trackedProperties_MessageId_g" and "trackedProperties_MessageId_s". Thanks for putting your effort into this! – TobiasJ Feb 28 '20 at 07:46
0
   To identify a property's data type, Azure Monitor adds a suffix to the property name. If a property contains a null value, the property is not included in that record. This table lists the property data type and corresponding suffix:

**RECORD TYPE AND PROPERTIES**
**Property data type Suffix**
String  =>  _s
Boolean  => _b
Double   =>  _d
Date/time =>  _t
GUID (stored as a string) => _g
pavan
  • 51
  • 1
  • 2