<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Regex for normalizing VERP styled e-mail addresses in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38067#M8629</link>
    <description>&lt;P&gt;Thanks, seems like there's no other possibility.&lt;BR /&gt;
I also got an answer from support that splunk doesn't replace more than one matching group in transforms.conf&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2011 15:02:33 GMT</pubDate>
    <dc:creator>Simon</dc:creator>
    <dc:date>2011-02-07T15:02:33Z</dc:date>
    <item>
      <title>Regex for normalizing VERP styled e-mail addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38062#M8624</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;

&lt;P&gt;For better bounce handling, we're using VERP styled from-addresses when sending mails through our postfix.
So when splunk parses the mail logs, I have values in the from-field like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;from=&amp;lt;bounce+baAABNQIIAAAAAMAAAARZXNEA@newsletter.domain.com&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I'm searching for a regex for search time extraction to remove the VERP id (all after the +).&lt;/P&gt;

&lt;P&gt;I tried to use a lookahead ?=, which when matches doesn't get added to the whole mach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\&amp;lt;(?&amp;lt;realfrom&amp;gt;[a-zA-Z]+(?=\+{1}[a-zA-Z]+)@.*)\&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this didn't work so far.
Any ideas how to get rid of the VERP id?&lt;/P&gt;

&lt;P&gt;Thanks
Simon&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2011 16:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38062#M8624</guid>
      <dc:creator>Simon</dc:creator>
      <dc:date>2011-02-03T16:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for normalizing VERP styled e-mail addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38063#M8625</link>
      <description>&lt;P&gt;You should be able to do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "\&amp;lt;(?&amp;lt;realfrom&amp;gt;\S+)\+\w+@"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tested this with this search on my system:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | head 1 | eval blah="from=&amp;lt;bounce+baAABNQIIAAAAAMAAAARZXNEA@newsletter.domain.com&amp;gt;" | rex field=blah "\&amp;lt;(?&amp;lt;realfrom&amp;gt;\S+)\+\w+@" | table blah realfrom
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Feb 2011 00:21:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38063#M8625</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2011-02-04T00:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for normalizing VERP styled e-mail addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38064#M8626</link>
      <description>&lt;P&gt;Hey, thanks for your answer, but it's important that I get the domain name (newsletter.domain.com) in my match too. Only using the username of the email address for identifying senders is not distinct enough.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2011 14:53:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38064#M8626</guid>
      <dc:creator>Simon</dc:creator>
      <dc:date>2011-02-04T14:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for normalizing VERP styled e-mail addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38065#M8627</link>
      <description>&lt;P&gt;The only valid option I can think of is to use the rex command with mode=sed to eliminate this part from the email address:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=mail mode=sed "s/\+\w+@/@/g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Feb 2011 20:01:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38065#M8627</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2011-02-04T20:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for normalizing VERP styled e-mail addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38066#M8628</link>
      <description>&lt;P&gt;Oh ok. In that case ziegfried is right, you'll want to use rex in sed mode.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2011 21:25:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38066#M8628</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2011-02-04T21:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for normalizing VERP styled e-mail addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38067#M8629</link>
      <description>&lt;P&gt;Thanks, seems like there's no other possibility.&lt;BR /&gt;
I also got an answer from support that splunk doesn't replace more than one matching group in transforms.conf&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2011 15:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-normalizing-VERP-styled-e-mail-addresses/m-p/38067#M8629</guid>
      <dc:creator>Simon</dc:creator>
      <dc:date>2011-02-07T15:02:33Z</dc:date>
    </item>
  </channel>
</rss>

