<?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: How to write the regex to extract these 2 fields from this result? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-these-2-fields-from-this/m-p/281896#M85078</link>
    <description>&lt;P&gt;Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 "UDP+PORT=(?&amp;lt;udp&amp;gt;\d+)" | rex max_match=0 "TCP_PORT=(?&amp;lt;tcp&amp;gt;\d+)" | eval z=mvzip(udp, tcp) | mvexpand z | table udp tcp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Jun 2016 17:17:28 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-06-06T17:17:28Z</dc:date>
    <item>
      <title>How to write the regex to extract these 2 fields from this result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-these-2-fields-from-this/m-p/281895#M85077</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;How  to extract the fields &lt;STRONG&gt;UDP_PORT&lt;/STRONG&gt; and &lt;STRONG&gt;TCP_PORT&lt;/STRONG&gt; from this result?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FIXED_SEVERITY_3=10, FIXED_SEVERITY_2=14, CONFIRMED_SEVERITY_2=13, CONFIRMED_SEVERITY_3=9, CONFIRMED_SEVERITY_1=3, ACTIVE_SEVERITY_3=2, CONFIRMED_SEVERITY_4=1, ACTIVE_SEVERITY_1=1, SCAN_DURATION=1647, UDP_PORT=123, UDP_PORT=514, TCP_PORT=22, TCP_PORT=514, TCP_PORT=5520, TCP_PORT=8000, TOTAL_VULNS=46
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jun 2016 17:03:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-these-2-fields-from-this/m-p/281895#M85077</guid>
      <dc:creator>kranthi851</dc:creator>
      <dc:date>2016-06-06T17:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract these 2 fields from this result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-these-2-fields-from-this/m-p/281896#M85078</link>
      <description>&lt;P&gt;Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 "UDP+PORT=(?&amp;lt;udp&amp;gt;\d+)" | rex max_match=0 "TCP_PORT=(?&amp;lt;tcp&amp;gt;\d+)" | eval z=mvzip(udp, tcp) | mvexpand z | table udp tcp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jun 2016 17:17:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-these-2-fields-from-this/m-p/281896#M85078</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-06T17:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract these 2 fields from this result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-these-2-fields-from-this/m-p/281897#M85079</link>
      <description>&lt;P&gt;One of these should do.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 "UDP_PORT=(?&amp;lt;UPD_PORT&amp;gt;\d+)|TCP_PORT=(?&amp;lt;TCP_PORT&amp;gt;\d+)" | ...

... | extract mv_add=true kvdelim='=' pairdelim=',' | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both will produce multi-value fields for each type of port, which you can then process using the mv* commands.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 17:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-these-2-fields-from-this/m-p/281897#M85079</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-06-06T17:21:42Z</dc:date>
    </item>
  </channel>
</rss>

