<?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 Field Extraction  (rex maybe?) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545417#M154483</link>
    <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am not good in Regular Expressions, I need you assist.&lt;/P&gt;&lt;P&gt;In my data, I have a field containing IPs and Ports but in specific sequence:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;...some text ... SourceIP DestIP SrcPort DestPort ....some text...&lt;BR /&gt;between them there is one SPACE.&lt;BR /&gt;as an example:&lt;BR /&gt;message=...w 2-APIS 0-External-1 tcp 10.0.12.13 40.126.31.8 55373 443 msg=\"HTTS...&lt;BR /&gt;&lt;BR /&gt;I need to extract fields for SrcIP, DestIP, SrcPort and DestPort.&lt;BR /&gt;when I use&lt;/P&gt;&lt;P&gt;&amp;nbsp;\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b \b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b \d* \d*&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;\b(?:[0-9]{1,3}\.){3}[0-9]{1,3} (?:[0-9]{1,3}\.){3}[0-9]{1,3}\b&amp;nbsp;\d* \d*&lt;BR /&gt;I can grab the 2 IPs and ports&amp;nbsp; with spaces between them.&lt;BR /&gt;I am confused about how to assign each to a new field.&lt;BR /&gt;Can someone help?&lt;BR /&gt;Or do I have to use REX for search time extraction?&lt;BR /&gt;Even to use REX, I appreciate your advices.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-Ali&lt;/P&gt;</description>
    <pubDate>Thu, 25 Mar 2021 14:49:16 GMT</pubDate>
    <dc:creator>a_n</dc:creator>
    <dc:date>2021-03-25T14:49:16Z</dc:date>
    <item>
      <title>Field Extraction  (rex maybe?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545417#M154483</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am not good in Regular Expressions, I need you assist.&lt;/P&gt;&lt;P&gt;In my data, I have a field containing IPs and Ports but in specific sequence:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;...some text ... SourceIP DestIP SrcPort DestPort ....some text...&lt;BR /&gt;between them there is one SPACE.&lt;BR /&gt;as an example:&lt;BR /&gt;message=...w 2-APIS 0-External-1 tcp 10.0.12.13 40.126.31.8 55373 443 msg=\"HTTS...&lt;BR /&gt;&lt;BR /&gt;I need to extract fields for SrcIP, DestIP, SrcPort and DestPort.&lt;BR /&gt;when I use&lt;/P&gt;&lt;P&gt;&amp;nbsp;\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b \b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b \d* \d*&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;\b(?:[0-9]{1,3}\.){3}[0-9]{1,3} (?:[0-9]{1,3}\.){3}[0-9]{1,3}\b&amp;nbsp;\d* \d*&lt;BR /&gt;I can grab the 2 IPs and ports&amp;nbsp; with spaces between them.&lt;BR /&gt;I am confused about how to assign each to a new field.&lt;BR /&gt;Can someone help?&lt;BR /&gt;Or do I have to use REX for search time extraction?&lt;BR /&gt;Even to use REX, I appreciate your advices.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-Ali&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 14:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545417#M154483</guid>
      <dc:creator>a_n</dc:creator>
      <dc:date>2021-03-25T14:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction  (rex maybe?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545424#M154484</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/176730"&gt;@a_n&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You should use captured group on regex.&amp;nbsp;&lt;/P&gt;&lt;P&gt;rex sample;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=message "\b(?&amp;lt;src_ip&amp;gt;(?:[0-9]{1,3}\.){3}[0-9]{1,3})\b \b(?&amp;lt;dest_ip&amp;gt;(?:[0-9]{1,3}\.){3}[0-9]{1,3})\b (?&amp;lt;src_port&amp;gt;\d*) (?&amp;lt;dest_port&amp;gt;\d*)"&lt;/LI-CODE&gt;&lt;P&gt;props.conf extract&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EXTRACT-fields = \b(?&amp;lt;src_ip&amp;gt;(?:[0-9]{1,3}\.){3}[0-9]{1,3})\b \b(?&amp;lt;dest_ip&amp;gt;(?:[0-9]{1,3}\.){3}[0-9]{1,3})\b (?&amp;lt;src_port&amp;gt;\d*) (?&amp;lt;dest_port&amp;gt;\d*)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Mar 2021 15:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545424#M154484</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-25T15:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction  (rex maybe?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545426#M154485</link>
      <description>&lt;P&gt;Dears,&lt;BR /&gt;I used this:&lt;BR /&gt;(?&amp;lt;srcip&amp;gt;\d+\.\d+\.\d+\.\d+) (?&amp;lt;dstip&amp;gt;\d+\.\d+\.\d+\.\d+) (?&amp;lt;srcpt&amp;gt;\d+) (?&amp;lt;dstpt&amp;gt;\d+)&lt;BR /&gt;&lt;BR /&gt;Seems ok, but does anyone have better idea?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 15:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545426#M154485</guid>
      <dc:creator>a_n</dc:creator>
      <dc:date>2021-03-25T15:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction  (rex maybe?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545428#M154487</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/176730"&gt;@a_n&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;src_ip&amp;gt;\d+\.\d+\.\d+\.\d+)\s+(?&amp;lt;dest_ip&amp;gt;\d+\.\d+\.\d+\.\d+)\s+(?&amp;lt;src_port&amp;gt;\d+)\s+(?&amp;lt;dest_port&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/UTRazw/1" target="_blank"&gt;https://regex101.com/r/UTRazw/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if you could share two or three full samples of your logs I could be more precise.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 15:04:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545428#M154487</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-03-25T15:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction  (rex maybe?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545429#M154488</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Undersood.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 15:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545429#M154488</guid>
      <dc:creator>a_n</dc:creator>
      <dc:date>2021-03-25T15:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction  (rex maybe?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545430#M154489</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 15:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-rex-maybe/m-p/545430#M154489</guid>
      <dc:creator>a_n</dc:creator>
      <dc:date>2021-03-25T15:07:27Z</dc:date>
    </item>
  </channel>
</rss>

