<?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: Filtering a Field Extracted with Rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filtering-a-Field-Extracted-with-Rex/m-p/514944#M144549</link>
    <description>&lt;P&gt;This works. Thank you! Wasn't having this problem with stats or dc after the rex, so didn't know mvindex was needed.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2020 13:26:13 GMT</pubDate>
    <dc:creator>user333</dc:creator>
    <dc:date>2020-08-19T13:26:13Z</dc:date>
    <item>
      <title>Filtering a Field Extracted with Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-a-Field-Extracted-with-Rex/m-p/514821#M144520</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having trouble with filtering fields extracted using rex as follows:&lt;/P&gt;&lt;P&gt;rex max_match=0 field=sessions_as_client "(?&amp;lt;SRC&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s--\&amp;gt;\s(?&amp;lt;DST&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(?&amp;lt;Port&amp;gt;\d+\/[a-zA-Z]+)"| where Port="123/UDP" | lookup dnslookup clientip as DST OUTPUT clienthost as DSTDNS | table Port DST DSTDNS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;&lt;SPAN class="t a"&gt;The field I am extracting looks as follows:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;&lt;SPAN class="t a"&gt;sessions_as_client&lt;/SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"1&lt;/SPAN&gt;&lt;SPAN class="t"&gt;.2.3.4&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;--&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="t"&gt;1.2.3.5:21/TCP&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class="t"&gt;ftp&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN class="t"&gt;1.2.3.4&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;--&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="t"&gt;1.2.3.5:23/TCP&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class="t"&gt;telnet&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN class="t"&gt;1.2.3.4&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;--&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="t h"&gt;&lt;SPAN class="t"&gt;1.2.3.5:123&lt;/SPAN&gt;/&lt;SPAN class="t"&gt;UDP&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; (ntp&lt;/SPAN&gt;&lt;SPAN class="t"&gt;/udp&lt;/SPAN&gt;&lt;SPAN&gt;)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am getting a table with the 123/UDP events as expected, but I am also getting the other events such as 21/TCP and 23/TCP in the same row as if each match from the rex statement was no longer applying to the search. Any recommendations are appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 03:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-a-Field-Extracted-with-Rex/m-p/514821#M144520</guid>
      <dc:creator>user333</dc:creator>
      <dc:date>2020-08-19T03:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a Field Extracted with Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-a-Field-Extracted-with-Rex/m-p/514829#M144522</link>
      <description>&lt;P&gt;&lt;SPAN&gt;| rex max_match=0 field=sessions_as_client "(?&amp;lt;SRC&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s--\&amp;gt;\s(?&amp;lt;DST&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(?&amp;lt;Port&amp;gt;\d+\/[a-zA-Z]+)"&lt;BR /&gt;| eval tmp=mvzip(SRC,mvzip(DST,Port))&lt;BR /&gt;| mvexpand tmp&lt;BR /&gt;| eval src=mvindex(split(tmp,","),0) , DST=mvindex(split(tmp,","),1), Port=mvindex(split(tmp,","),2)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;| where Port="123/UDP"&lt;BR /&gt;| lookup dnslookup clientip as DST OUTPUT clienthost as DSTDNS&lt;BR /&gt;| table Port DST DSTDNS&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 03:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-a-Field-Extracted-with-Rex/m-p/514829#M144522</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-19T03:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a Field Extracted with Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-a-Field-Extracted-with-Rex/m-p/514944#M144549</link>
      <description>&lt;P&gt;This works. Thank you! Wasn't having this problem with stats or dc after the rex, so didn't know mvindex was needed.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 13:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-a-Field-Extracted-with-Rex/m-p/514944#M144549</guid>
      <dc:creator>user333</dc:creator>
      <dc:date>2020-08-19T13:26:13Z</dc:date>
    </item>
  </channel>
</rss>

