Extracting a string from email created ticket

Hello, I am relative new to RT, however, am very familiar with its use. I have just recently downloaded and installed the latest version as a new install. I have no problems with the product at all. However, the need to extract various string from the email that is being sent to RT and place those strings into Custom Fields is paramount. I have found several web “HowTo”, listing in other forums as well as several examples, all of which DO NOT WORK with this current latest version of RT.

I have also installed the RT-Extension-ExtractCustomFieldValues-3.14 add on, which did show some results in logs, but it does not appear to work either.

I have created a template in side a group and assigned a script. Some

The Template:
TYpe is Simple
using: SourceAddress|Body|Source Address\s*(\w$)|

The Script:
Condition: On Create
Action: Extract Custom Field Values With Code in Template
Template is defined with the above listed template’s name.

The above works fine and does produce a log entry and the CF is populated with the first word in “Source Address” string ot the email. In this case the value is 192.

However, I can NOT get any other regex extraction process to work. The email contains:

The email contains the following:

Resource address: xxx.xxx.xxx.xxx:port_numer

I am wanting to find the string “Resource address” from the body of the email and extract the ip address (not including the port number) to custom field name ResourceAddress

What do I put in the template to make this work.

Thank you for any help with this process

Hello, I am also new to RT currently facing the issue RT 5.0.3 trying to extract IP address from incoming emails into custom field. However i have managed to create custom field.

I assume you’ve tried:

SourceAddress|Body|Reource address:\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):|

as the pattern for the IP address?

Are you using the RT-Extension-ExtractCustomFieldValues extension, or trying to code a Perl template yourself to do it? If the former try my reply above. If the latter it’ll need a bit more coding to find the MIME body part in the email you’re interested in, extract the value and then insert it into a custom field. Doable, but if you’re not comfy with Perl coding the extension might be a better first bet for you.