<?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 do I map these fields from my sample log file at index or search-time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-map-these-fields-from-my-sample-log-file-at-index-or/m-p/245105#M73053</link>
    <description>&lt;P&gt;In general, we recommend search-time extractions rather than index-time extractions. There are relatively few cases where index-time extractions are better, and they come at the cost of brittleness of configuration and an increase in index size (which in turn makes searches slower).&lt;/P&gt;

&lt;P&gt;You can still save your search time field extraction in props.conf (see this &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Add_an_EXTRACT_field_extraction_stanza_to_props.conf"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Add_an_EXTRACT_field_extraction_stanza_to_props.conf&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;YOu can use the following regex in props.conf (showing inline search field extraction)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "pass proto (?&amp;lt;protocol&amp;gt;\S+) from (?&amp;lt;src_ip&amp;gt;\d+\.\d+\.\d+\.\d+):(?&amp;lt;src_port&amp;gt;\d+) to (?&amp;lt;dest_ip&amp;gt;\d+\.\d+\.\d+\.\d+):(?&amp;lt;dest_port&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Jul 2016 15:39:27 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-07-06T15:39:27Z</dc:date>
    <item>
      <title>How do I map these fields from my sample log file at index or search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-map-these-fields-from-my-sample-log-file-at-index-or/m-p/245104#M73052</link>
      <description>&lt;P&gt;Hello. I have the following log file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-06-28T10:08:08.152Z: pass proto tcp from 10.60.13.19:33099 to 10.193.44.12:443
2016-06-28T10:08:08.221Z: pass proto udp from 10.194.125.121:35984 to 10.60.13.18:161
2016-06-28T10:08:08.152Z: pass proto tcp from 10.60.13.19:33099 to 10.193.44.12:443
2016-06-28T10:08:08.221Z: pass proto icmp from 10.194.125.121 to 10.60.13.18
2016-06-28T10:08:08.491Z: pass proto tcp from 10.60.13.18:40070 to 10.193.44.11:443
2016-06-28T10:08:08.491Z: pass proto tcp from 10.60.13.18:40070 to 10.193.44.11:443
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to map protocol ( tcp/udp ), the From address and port #, the to address and port #. &lt;/P&gt;

&lt;P&gt;Is it best to do this at search-time or at index-time? If at index time how would I do this in my props and transforms?&lt;/P&gt;

&lt;P&gt;THANK YOU as always!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 14:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-map-these-fields-from-my-sample-log-file-at-index-or/m-p/245104#M73052</guid>
      <dc:creator>brent_weaver</dc:creator>
      <dc:date>2016-07-06T14:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I map these fields from my sample log file at index or search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-map-these-fields-from-my-sample-log-file-at-index-or/m-p/245105#M73053</link>
      <description>&lt;P&gt;In general, we recommend search-time extractions rather than index-time extractions. There are relatively few cases where index-time extractions are better, and they come at the cost of brittleness of configuration and an increase in index size (which in turn makes searches slower).&lt;/P&gt;

&lt;P&gt;You can still save your search time field extraction in props.conf (see this &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Add_an_EXTRACT_field_extraction_stanza_to_props.conf"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Add_an_EXTRACT_field_extraction_stanza_to_props.conf&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;YOu can use the following regex in props.conf (showing inline search field extraction)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "pass proto (?&amp;lt;protocol&amp;gt;\S+) from (?&amp;lt;src_ip&amp;gt;\d+\.\d+\.\d+\.\d+):(?&amp;lt;src_port&amp;gt;\d+) to (?&amp;lt;dest_ip&amp;gt;\d+\.\d+\.\d+\.\d+):(?&amp;lt;dest_port&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 15:39:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-map-these-fields-from-my-sample-log-file-at-index-or/m-p/245105#M73053</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-06T15:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I map these fields from my sample log file at index or search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-map-these-fields-from-my-sample-log-file-at-index-or/m-p/245106#M73054</link>
      <description>&lt;P&gt;I would do search-time like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Base Search Here | rex "\d+-\d+-\d+T\d+:\d+:\d+.\d+[^:]*:.*?(?&amp;lt;protocol&amp;gt;\w+) from (?&amp;lt;src&amp;gt;\d+\.\d+\.\d+\.\d+(?::\d+)?) to (?&amp;lt;dest&amp;gt;\d+\.\d+\.\d+\.\d+(?::\d+)?)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 18:05:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-map-these-fields-from-my-sample-log-file-at-index-or/m-p/245106#M73054</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-06T18:05:39Z</dc:date>
    </item>
  </channel>
</rss>

