[rt-users] ExtractCustomField Regexp Help Needed

Ryan Fox rfox at findlay.edu
Thu Nov 1 09:49:05 EDT 2007


Tim Wilson wrote:
>>>> On Wed, Oct 31, 2007 at  8:47 PM, in message
>>>>         
> <E9111BE9-3508-4D51-83BF-D4B32EDD3DDC at mepad.net>, Darren Ellis
> <darren at mepad.net> wrote: 
>
>   
>> I am using ExtractCustomField to try to populate some custom fields by  
>> scanning for values in the body of the incoming message.  My regexp  
>> needs to match a starting string and then grab everything to the end  
>> of the line.  I have the regexp working with egrep in the bash shell,  
>> but my custom fields aren't being populated.
>>     
>
> Darren,
>
> I believe that the ExtractCustomField code is only able to inspect the email headers to look for matches. I don't think it can look in the message body.
>   

Sure it can.  Here's my template for taking everything after 'Host:' 
(useful for Nagios alert)

Server|Body|Host:\s(.*)$||

One thing I notice is that the example and mine both have Body 
capitalized, while the OP doesn't.  You might try changing that. 
Maybe this would work (untested).

Customer Name|Body|CSR Contact Name\s*(.*)$||

Ryan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: rfox.vcf
Type: text/x-vcard
Size: 277 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20071101/15eaa3b0/attachment.vcf>


More information about the rt-users mailing list