0 Replies Latest reply on Feb 1, 2016 3:50 PM by tbelanger

    Issue with regex meta-character in Universal Device Poller

    tbelanger

      Hello All,

       

      I am trying to create a Universal Device Poller for node details and ran into an issue polling for software image. I am polling OID 1.3.6.1.4.1.9.9.25.1.1.1.2.2 and it returns a value of "CW_IMAGE$C3750E-UNIVERSALK9-M$" Since, I am only interested in whats between the dollar signs, regex is perfect for this.

       

      After polling this value, I click on "add calculated value" and use the following line

       

      Regex([softwareImage], "\$.*")

       

      After trying to test, it wont even show me the output/input of the value. Once I remove the slash, it shows nothing for the output (I assume this is because $ is being matched as end of line). Any other expressions not involving escaped characters work just fine. I thought perhaps maybe I am not escaping it correctly until I tried using the Replace function. It works just fine to replace $ with @ in my test

       

      Replace([softwareImage],"$","@")

       

      So I came up with this which words correctly (even removes the dollar signs).

       

      Replace(Replace([softwareImage],"CW_IMAGE$",""),"$","")

       

      I am hoping I am just not escaping this correctly, but I can not find anything in the documentation advising on to do it correctly in this part of Solarwinds. Perhaps there is a better method all together ?