<?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 Best practice for field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92715#M23937</link>
    <description>&lt;P&gt;What is the best option for field extraction?&lt;/P&gt;

&lt;P&gt;my log file contain some data separated with # and I want to convert these data in tabular format.&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;P&gt;ID#Data-1#Value-1#TRANS ID#.... so on&lt;/P&gt;

&lt;P&gt;due to performance reason in our system I can't use key-pair in log so I want to extract this in Splunk.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jul 2012 16:18:40 GMT</pubDate>
    <dc:creator>jangid</dc:creator>
    <dc:date>2012-07-06T16:18:40Z</dc:date>
    <item>
      <title>Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92715#M23937</link>
      <description>&lt;P&gt;What is the best option for field extraction?&lt;/P&gt;

&lt;P&gt;my log file contain some data separated with # and I want to convert these data in tabular format.&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;P&gt;ID#Data-1#Value-1#TRANS ID#.... so on&lt;/P&gt;

&lt;P&gt;due to performance reason in our system I can't use key-pair in log so I want to extract this in Splunk.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2012 16:18:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92715#M23937</guid>
      <dc:creator>jangid</dc:creator>
      <dc:date>2012-07-06T16:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92716#M23938</link>
      <description>&lt;P&gt;There are two major types of field extraction: index time and search time. Search time is the best practice, especially for the example you have given. There are many ways to implement search time field extraction. In general, they all do the same thing with similar performance. So it is mostly a matter of "how is it easiest to specify what I want?"&lt;/P&gt;

&lt;P&gt;In your case, I recommend that you use the REPORT extraction. It works like this. On the indexer(s) - or search head if you are using one - edit these configuration files:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
REPORT-extract1=extract-my-fields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract-my-fields]
REGEX = ([^#]+)#([^#]+)#([^#]+)#([^#]+)# and so on
FORMAT = id::$1  Data-1::$2  Value-1::$3  transId::$4  and so on to match the previous line
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;HTH!&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jul 2012 02:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92716#M23938</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-07-07T02:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92717#M23939</link>
      <description>&lt;P&gt;The other way to do this is through the use of delimiters and specifying your fields like this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
REPORT-fields = extract-my-fields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract-my-fields]
DELIMS = "#"
FIELDS = "id", "Data-1", "Value-1", "transId", ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure which of the two is better (ie. less computationally expensive), but I usually use the way I have listed (so long as you have a common delimiter).&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jul 2012 02:26:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92717#M23939</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2012-07-07T02:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92718#M23940</link>
      <description>&lt;P&gt;Hi Lisa, is there any benefit using either of our methods over the other? Seems like they are both a means to the same end, except when you're extracting fields from a event with inconsistent delimiters (or delimiters in the values).&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jul 2012 02:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92718#M23940</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2012-07-07T02:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92719#M23941</link>
      <description>&lt;P&gt;I like this answer too. It is easier  when the delimiter is consistent.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2012 00:51:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92719#M23941</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-07-08T00:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92720#M23942</link>
      <description>&lt;P&gt;Except for rare corner cases, index-time field extraction does &lt;STRONG&gt;not&lt;/STRONG&gt; perform better than search-time field extraction. In addition, index-time field extraction has other issues that make it less desirable overall.&lt;/P&gt;

&lt;P&gt;I don't think there is any performance difference between the various methods of specifying search-time field extraction -- it is just a matter of which way is easiest  to specify. Your (R. Turk's) answer is excellent for this particular case. At other times, you may not be able to use DELIMS and will need to go with this solution.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2012 00:56:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92720#M23942</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-07-08T00:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92721#M23943</link>
      <description>&lt;P&gt;Thanks its help me.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2012 12:38:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92721#M23943</guid>
      <dc:creator>jangid</dc:creator>
      <dc:date>2012-07-11T12:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92722#M23944</link>
      <description>&lt;P&gt;How do I create multiple fields in log?&lt;/P&gt;

&lt;P&gt;e.g.&lt;BR /&gt;
my log contains following information&lt;BR /&gt;
[Counter-1] id#data1#data2#data2.. and so on ..&lt;BR /&gt;
[Counter-2] id#data1#data2#data2.. and so on ..&lt;BR /&gt;
[Counter-3] id#data1#data2#data2.. and so on ..&lt;/P&gt;

&lt;P&gt;Now I want to create field based on the [Counter-n] keyword&lt;/P&gt;

&lt;P&gt;[Counter-1] id#data1#data2#data2.. and so on ..&lt;BR /&gt;
FIELDS - Counter_1_id, Counter_1_data1, Counter_1_data2, ... so on&lt;/P&gt;

&lt;P&gt;[Counter-2] id#data1#data2#data2.. and so on ..&lt;BR /&gt;
FIELDS - Counter_2_id, Counter_2_data1, Counter_2_data2, ... so on&lt;/P&gt;

&lt;P&gt;[Counter-3] id#data1#data2#data2.. and so on ..&lt;BR /&gt;
FIELDS - Counter_3_id, Counter_3_data1, Counter_3_data2, ... so on&lt;/P&gt;

&lt;P&gt;Note - I want to create these fields only if [Counter-n] exist&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Manoj&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:03:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92722#M23944</guid>
      <dc:creator>jangid</dc:creator>
      <dc:date>2020-09-28T12:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92723#M23945</link>
      <description>&lt;P&gt;I tried with above given method I am able to get the fields but some unnecessary fields also creating.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;REPORT-jt_fields = extract_jt_field&lt;/P&gt;

&lt;P&gt;transform.conf&lt;/P&gt;

&lt;P&gt;[extract_jt_field]&lt;BR /&gt;
REGEX = "Counter-1"&lt;BR /&gt;
DELIMS = "#"&lt;BR /&gt;
FIELDS = "Counter_1_id","Counter_1_data1","Counter_1_data2"&lt;/P&gt;

&lt;P&gt;am I doing anything wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:03:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Best-practice-for-field-extraction/m-p/92723#M23945</guid>
      <dc:creator>jangid</dc:creator>
      <dc:date>2020-09-28T12:03:47Z</dc:date>
    </item>
  </channel>
</rss>

