<?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 How to extract source and destination IP fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332647#M98957</link>
    <description>&lt;P&gt;I am trying to configure various search fields for a firewall log from the field extractor but Splunk is pulling up some incorrect results. Any help would be appreciated. The two images are examples of the logs.&lt;/P&gt;

&lt;P&gt;Here is the expression that incorrectly pulls up some results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^[^/\n]*/(?P[^\(]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2570iC80C03BE4A9A16FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2571i87C9A43AE80DA396/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2017 16:23:00 GMT</pubDate>
    <dc:creator>rootchin</dc:creator>
    <dc:date>2017-03-01T16:23:00Z</dc:date>
    <item>
      <title>How to extract source and destination IP fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332647#M98957</link>
      <description>&lt;P&gt;I am trying to configure various search fields for a firewall log from the field extractor but Splunk is pulling up some incorrect results. Any help would be appreciated. The two images are examples of the logs.&lt;/P&gt;

&lt;P&gt;Here is the expression that incorrectly pulls up some results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^[^/\n]*/(?P[^\(]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2570iC80C03BE4A9A16FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2571i87C9A43AE80DA396/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 16:23:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332647#M98957</guid>
      <dc:creator>rootchin</dc:creator>
      <dc:date>2017-03-01T16:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract source and destination IP fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332648#M98958</link>
      <description>&lt;P&gt;What results are you getting and what do you expect?&lt;/P&gt;

&lt;P&gt;A copy-and-paste of the event text is more helpful than a screen shot.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 16:54:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332648#M98958</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-03-01T16:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract source and destination IP fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332649#M98959</link>
      <description>&lt;P&gt;As richgalloway mentioned copy past would be usefull. By the title I assume you are looking for the source and destination fields. &lt;/P&gt;

&lt;P&gt;For your first example    &lt;CODE&gt;inside:(?&amp;lt;src_ip&amp;gt;[^\/]+)\/(?&amp;lt;src_port&amp;gt;\d+) dst outside:(?&amp;lt;dest_ip&amp;gt;[^\/]+)\/(?&amp;lt;dest_port&amp;gt;\d+)&lt;/CODE&gt; might be a fitting regex. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;something something ... deny tcp src inside:123.123.123.123/444 dst outside:111.222.333.444/555 .... 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I personally would go with another extraction for your other example since both events are not quite similar but I'm sure someone else would combine both. &lt;/P&gt;

&lt;P&gt;For the second example    &lt;CODE&gt;permitted \w+ \w+\/(?&amp;lt;src_ip&amp;gt;[^\(]+)\(\w+\) -&amp;gt; outside\/(?&amp;lt;dest_ip&amp;gt;[^\(]+)&lt;/CODE&gt; might fit. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;something something ... permitted udp dmz/111.222.333.444(123) -&amp;gt; outside/123.123.123.123(123) .... 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Mar 2017 17:25:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332649#M98959</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2017-03-01T17:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract source and destination IP fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332650#M98960</link>
      <description>&lt;P&gt;First Extraction: &lt;A href="https://regex101.com/r/CFOb1y/1"&gt;https://regex101.com/r/CFOb1y/1&lt;/A&gt;&lt;BR /&gt;
Second Extraction: &lt;A href="https://regex101.com/r/43d4OA/1"&gt;https://regex101.com/r/43d4OA/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Obviously, if you provide a full log, I could help more, but this should get you started.&lt;/P&gt;

&lt;P&gt;Also, check this out: &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Scrub"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Scrub&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And if you want a CIM compliant TA for Cisco ASA, I would try: &lt;A href="https://splunkbase.splunk.com/app/1620/"&gt;https://splunkbase.splunk.com/app/1620/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Odds are, the Splunk extractions are better.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 20:31:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-source-and-destination-IP-fields/m-p/332650#M98960</guid>
      <dc:creator>bshuler_splunk</dc:creator>
      <dc:date>2017-03-01T20:31:24Z</dc:date>
    </item>
  </channel>
</rss>

