Hi,
Is there any way to pre-process a return value on some dynamic way in item prototypes?
So I've got a api query which return about disks and bunch of properties.
I have regex to cut out the desired value from the line, but it each item required to have a the ID in the regex to know which device it belongs to...
Exaple regex:
(\S{1,10})\W\W(propertyName).*[.](1)\s[=]\s.{1,10}\W\s(\d{1,16}|[a-zA-Z 0-9]{1,16})
So in each item the red number would represent the disk id and group 4 would return a the actual value of propertyName
I have managed to chuck this into a discovery so it does find the disks and create the items, but currently without manual intervention, it would record the property of each disks in each item (as text).. If I could parameter up a regex in the item prototype, I could cut of the desired value, but I would need to insert in at least the discovered diskID in there.
Is there way with macro or whatever to do that?
Thanks again
Is there any way to pre-process a return value on some dynamic way in item prototypes?
So I've got a api query which return about disks and bunch of properties.
I have regex to cut out the desired value from the line, but it each item required to have a the ID in the regex to know which device it belongs to...
Exaple regex:
(\S{1,10})\W\W(propertyName).*[.](1)\s[=]\s.{1,10}\W\s(\d{1,16}|[a-zA-Z 0-9]{1,16})
So in each item the red number would represent the disk id and group 4 would return a the actual value of propertyName
I have managed to chuck this into a discovery so it does find the disks and create the items, but currently without manual intervention, it would record the property of each disks in each item (as text).. If I could parameter up a regex in the item prototype, I could cut of the desired value, but I would need to insert in at least the discovered diskID in there.
Is there way with macro or whatever to do that?
Thanks again
Comment