There is a poller that returns a 64 character string (APC's upsBasicStateOutputState). Each each individual digit represents a different flag condition (I have included the first few below).
This means that if the string is "00011..." It would signify that the battery needs to be replaced and that the device is On Line. I am trying to find a way top parse out the 44 different flags for alerting and reports. I thought I could do it using a parse poller transformation, but despite the regex working in C# regex testers, it just returns and error. The goal was to only return only a single digit for each flag (meaning I would create 44 of these). I could do it with SQL, but then it becomes harder for my coworkers to figure out what I've done and use it themselves. Any help would be greatly appreciated!
Regex
(?<=^.{8})\d
Parse
parse(((?<=^.{8})\d ), {upsBasicStateOutputState})
1 | Abnormal Condition Present |
2 | On Battery |
3 | Low Battery |
4 | On Line |
5 | Replace Battery |