<?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 Extract fields during source type creation in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266210#M51017</link>
    <description>&lt;P&gt;I have log file that has combination of plain text and key value pairs separated by "|". How can i extract all the fields from log. below is the sample data I'm trying to index. &lt;/P&gt;

&lt;P&gt;01/16/2017 11:09:15|SNMPv2c|hostname|IP address|0|sonusNodeServerCongestionNotification|sysUpTime : 98677211|snmpTrapOID : sonusNodeServerCongestionNotification|sonusShelfIndex : 1|sonusSlotIndex : 5|sonusOverloadLevel : 1|sonusEventDescription : Shelf 1 slot 5 card congestion level 1.|sonusEventClass : 1|sonusEventLevel : 2|sonusSequenceId : 57031|sonusEventTime : 1484582955|sonusSequenceEpoch : 41|hostID&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2017 20:30:59 GMT</pubDate>
    <dc:creator>jayakumar89</dc:creator>
    <dc:date>2017-01-31T20:30:59Z</dc:date>
    <item>
      <title>Extract fields during source type creation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266210#M51017</link>
      <description>&lt;P&gt;I have log file that has combination of plain text and key value pairs separated by "|". How can i extract all the fields from log. below is the sample data I'm trying to index. &lt;/P&gt;

&lt;P&gt;01/16/2017 11:09:15|SNMPv2c|hostname|IP address|0|sonusNodeServerCongestionNotification|sysUpTime : 98677211|snmpTrapOID : sonusNodeServerCongestionNotification|sonusShelfIndex : 1|sonusSlotIndex : 5|sonusOverloadLevel : 1|sonusEventDescription : Shelf 1 slot 5 card congestion level 1.|sonusEventClass : 1|sonusEventLevel : 2|sonusSequenceId : 57031|sonusEventTime : 1484582955|sonusSequenceEpoch : 41|hostID&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 20:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266210#M51017</guid>
      <dc:creator>jayakumar89</dc:creator>
      <dc:date>2017-01-31T20:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields during source type creation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266211#M51018</link>
      <description>&lt;P&gt;You can add following on your Search Head&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceType]
REPORT-getfields = extract_kv_pairs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract_kv_pairs]
DELIMS = "|", ":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Restart Splunk after making change.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 22:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266211#M51018</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-31T22:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields during source type creation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266212#M51019</link>
      <description>&lt;P&gt;@somesonie Thanks and it works. I would like to extract the first 5 fields and provide FIELD-NAME to them. how can i do that ?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 15:50:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266212#M51019</guid>
      <dc:creator>jayakumar89</dc:creator>
      <dc:date>2017-02-01T15:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields during source type creation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266213#M51020</link>
      <description>&lt;P&gt;YOu need to setup field extraction in props.conf like this.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [YourSourceType]
 REPORT-getfields = extract_kv_pairs
 EXTRACT-firstfive = ^(?&amp;lt;fieldname1&amp;gt;[^\|]+)\|(?&amp;lt;fieldname2&amp;gt;[^\|]+)\|(?&amp;lt;fieldname3&amp;gt;[^\|]+)\|(?&amp;lt;fieldname4&amp;gt;[^\|]+)\|(?&amp;lt;fieldname5&amp;gt;[^\|]+)\|
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Feb 2017 16:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266213#M51020</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-01T16:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields during source type creation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266214#M51021</link>
      <description>&lt;P&gt;It helped. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 20:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-during-source-type-creation/m-p/266214#M51021</guid>
      <dc:creator>jayakumar89</dc:creator>
      <dc:date>2017-02-01T20:31:26Z</dc:date>
    </item>
  </channel>
</rss>

