[rt-users] Is anyone successfully using ExtractCustomFieldValues with a multiple-value IP address field?
trs at bestpractical.com
Mon Mar 4 18:26:11 EST 2013
On 03/04/2013 03:08 PM, Lundberg, Emory wrote:
> I have a scrip and template that use ExtractCustomFieldValues to pull
> things out of the body of a message. The problem I have is that I can't
> seem to figure out how to format this for a multi-value IP address field.
> What is the preferred method of inserting these IP addresses using
> Should they be space or comma-seperated? Should they be looped? Should
> they be repeated in the body of the message individually?
Multiple matches for each value should do the right thing. So should a
single match with the values separated by newlines, but that I'm less
sure of and didn't verify in the code.
> An example of strange behavior I'm seeing when attempting to
> set 192.168.155.130 and 192.168.155.133 as values in a multi-value IP
> address field:
> [Mon Mar 4 22:13:34 2013] [debug]: Found value for CF:
> [Mon Mar 4 22:13:34 2013] [info]: CustomFieldValue
> (VIPS,X-VIPS:192.168.155.130) added: 0 Could not add new custom field
> value: Couldn't create record: Content is an invalid IP address
> [Mon Mar 4 22:13:34 2013] [debug]: Found value for
> CF: 192.168.155.133
> Needless to say I'm surely doing something wrong, I just don't know what.
Look at the first error message you get. It's telling you that the
value it tried to add is "X-VIPS:192.168.155.130" The "X-VIPS:" part of
that is not a valid IP address. The second value succeeds because it's
a bare IP address. Looks like you need to fix your regex.
More information about the rt-users