4 Replies Latest reply on Mar 21, 2019 2:15 AM by Björn Bergström

    MRL - Get text from $EV.mc.notes to string variable?

    Björn Bergström
      Share:|

      Hello,

       

      I am trying to fetch annotation data from $EV.mc.notes in our refine rule and put it in another variable.

       

      It looks as i do not get any data in the $EV.mc.notes when i get the event the first time so that it´s empty.

       

      Can someone help me with this?  Roland Pocek

      Rookie MRL guy

       

      When Event is created mc.notes contains below data:

      mc_notes=['0x5c9220eb','annotation_attach.mrl:new update_annotation_alarm',''"Beredskap Habanero SLA Healthcheck Habanero":1.0','"Beredskap Habanero SLA Healthcheck Habanero genom F5":0.0','"Beredskap värdminne alert gdsfastighet001":44.095235669476914'','0x5c9220af','annotation_attach.mrl:new update_annotation_alarm',''"Beredskap Habanero SLA Healthcheck Habanero":1.0','"Beredskap Habanero SLA Healthcheck Habanero genom F5":0.0','"Beredskap värdminne alert gdsfastighet001":44.095235669476914'','0x5c922073','annotation_attach.mrl:new update_annotation_alarm',''"Beredskap Habanero SLA Healthcheck Habanero":1.0','"Beredskap Habanero SLA Healthcheck Habanero genom F5":0.0','"Beredskap värdminne alert gdsfastighet001":44.095235669476914'','0x5c922037','annotation_attach.mrl:new update_annotation_alarm',''"Beredskap Habanero SLA Healthcheck Habanero":1.0','"Beredskap Habanero SLA Healthcheck Habanero genom F5":0.0','"Beredskap värdminne alert gdsfastighet001":44.095235669476914'','0x5c921ffb','annotation_attach.mrl:new update_annotation_alarm',''"Beredskap Habanero SLA Healthcheck Habanero":1.0','"Beredskap Habanero SLA Healthcheck Habanero genom F5":0.0','"Beredskap värdminne alert gdsfastighet001":44.095235669476914''];

       

      refine refine_message_GDS_Fastighet:
      EVENT($EV)
      where [ ($EV.mc_object_class contains "LM_APP00420_GDS_Fastighet") ]
      {
      $LEN = listlen($EV.mc_notes);
      if ($LEN >= 1) then
      {
      $VAL = listgetelt($EV.mc_notes,1);
      $Newlist = strtolist($VAL,',');
      $STR = listgetelt($Newlist,1);

       

      }
      # else
      {
      $STR = "";
      }; 
        $EV.lm_extra = $STR;
        }
      END

       

      In the .Load file we have the Refine rule after the annotation_attach rule.

       

      Regards

       

      Björn