<?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 Combine/ Compare two REX fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-Compare-two-REX-fields/m-p/203605#M59138</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm having the two REX fields and want to search the logs with those fields. Which one matches that field needs to be given as output. Below are the REX&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;rex "^(?:[^:\n]&lt;/EM&gt;:){5}\s+(?P&amp;lt;email_2dot&amp;gt;\w+.\w+.\w+@\w+.\w+)"&lt;BR /&gt;
rex "^(?:[^:\n]&lt;EM&gt;:){5}\s+(?P&amp;lt;email_dot&amp;gt;\w+.\w+@\w+.\w+)"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;and i want to display with the same name &lt;STRONG&gt;EMAIL&lt;/STRONG&gt; since need of only one field in the result. as i can get the result in the two fields &lt;EM&gt;email_2dot and email_dot&lt;/EM&gt; but it should be as single field. Please help on this. If you have any concern please comment.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 08:14:28 GMT</pubDate>
    <dc:creator>kamaleshwar</dc:creator>
    <dc:date>2020-09-29T08:14:28Z</dc:date>
    <item>
      <title>Combine/ Compare two REX fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-Compare-two-REX-fields/m-p/203605#M59138</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm having the two REX fields and want to search the logs with those fields. Which one matches that field needs to be given as output. Below are the REX&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;rex "^(?:[^:\n]&lt;/EM&gt;:){5}\s+(?P&amp;lt;email_2dot&amp;gt;\w+.\w+.\w+@\w+.\w+)"&lt;BR /&gt;
rex "^(?:[^:\n]&lt;EM&gt;:){5}\s+(?P&amp;lt;email_dot&amp;gt;\w+.\w+@\w+.\w+)"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;and i want to display with the same name &lt;STRONG&gt;EMAIL&lt;/STRONG&gt; since need of only one field in the result. as i can get the result in the two fields &lt;EM&gt;email_2dot and email_dot&lt;/EM&gt; but it should be as single field. Please help on this. If you have any concern please comment.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-Compare-two-REX-fields/m-p/203605#M59138</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2020-09-29T08:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Combine/ Compare two REX fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-Compare-two-REX-fields/m-p/203606#M59139</link>
      <description>&lt;P&gt;Just name the field the same in both rex commands:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  rex "^(?:[^:n]:){5}s+(?P&amp;lt;email&amp;gt;w+.w+.w+@w+.w+)" | rex "^(?:[^:n]:){5}s+(?P&amp;lt;email&amp;gt;w+.w+@w+.w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or use rename:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  rex "^(?:[^:n]:){5}s+(?P&amp;lt;email&amp;gt;w+.w+.w+@w+.w+)" | rex "^(?:[^:n]:){5}s+(?P&amp;lt;email2&amp;gt;w+.w+@w+.w+)" | rename email2 AS email
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jan 2016 12:15:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-Compare-two-REX-fields/m-p/203606#M59139</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-01T12:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Combine/ Compare two REX fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-Compare-two-REX-fields/m-p/203607#M59140</link>
      <description>&lt;P&gt;If we rename it as email, would it not over write the previous value?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 16:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-Compare-two-REX-fields/m-p/203607#M59140</guid>
      <dc:creator>kamaleshwar</dc:creator>
      <dc:date>2019-11-19T16:24:30Z</dc:date>
    </item>
  </channel>
</rss>

