<?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 do field extraction using transform? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591073#M205779</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am facing difficulty at index time fields extraction.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My sample log file format:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Time stamp: Fri Mar 18 00:00:49 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:50 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:51 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:52 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:53 2022
File: File_name_1
Renamed to: Rename_1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;props.conf

[ demo ]
CHARSET=AUTO
LINE_BREAKER=([\r\n]+)
MAX_TIMESTAMP_LOOKAHEAD=24
NO_BINARY_CHECK=true
SHOULD_LINEMERGE=true
TIME_FORMAT=%a %b %d %H:%M:%S %Y
TIME_PREFIX=^Time stamp:\s+
TRANSFORMS-extractfield=extract_demo_field
TRUNCATE=100000

transforms.conf
[extract_demo_field]
REGEX =^Time stamp:\s*(?&amp;lt;timeStamp&amp;gt;.*)$\s*^File:\s*(?&amp;lt;file&amp;gt;.*)$\s*^Renamed to:\s+(?&amp;lt;renameFile&amp;gt;.*)$
FORMAT = time_stamp::$1 file::$2 renamed_to::$3
WRITE_META = true&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Mar 2022 16:29:01 GMT</pubDate>
    <dc:creator>arun_kant_sharm</dc:creator>
    <dc:date>2022-03-28T16:29:01Z</dc:date>
    <item>
      <title>How to do field extraction using transform?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591073#M205779</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am facing difficulty at index time fields extraction.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My sample log file format:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Time stamp: Fri Mar 18 00:00:49 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:50 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:51 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:52 2022
File: File_name_1
Renamed to: Rename_1

Time stamp: Fri Mar 18 00:00:53 2022
File: File_name_1
Renamed to: Rename_1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;props.conf

[ demo ]
CHARSET=AUTO
LINE_BREAKER=([\r\n]+)
MAX_TIMESTAMP_LOOKAHEAD=24
NO_BINARY_CHECK=true
SHOULD_LINEMERGE=true
TIME_FORMAT=%a %b %d %H:%M:%S %Y
TIME_PREFIX=^Time stamp:\s+
TRANSFORMS-extractfield=extract_demo_field
TRUNCATE=100000

transforms.conf
[extract_demo_field]
REGEX =^Time stamp:\s*(?&amp;lt;timeStamp&amp;gt;.*)$\s*^File:\s*(?&amp;lt;file&amp;gt;.*)$\s*^Renamed to:\s+(?&amp;lt;renameFile&amp;gt;.*)$
FORMAT = time_stamp::$1 file::$2 renamed_to::$3
WRITE_META = true&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 16:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591073#M205779</guid>
      <dc:creator>arun_kant_sharm</dc:creator>
      <dc:date>2022-03-28T16:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction using transform</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591076#M205780</link>
      <description>&lt;P&gt;Firstly, what is your problem? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Secondly, if you use $1, $2 and so on, you don't neet to name capture groups.&lt;/P&gt;&lt;P&gt;And finally, did you define entries in fields.conf for indexed fields?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 11:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591076#M205780</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-03-28T11:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction using transform</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591112#M205796</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/173134"&gt;@arun_kant_sharm&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't set forcefully anything in Splunk.&lt;/P&gt;&lt;P&gt;Splunk even understand this timestamp as well.&lt;/P&gt;&lt;P&gt;No need to extract time and setting transform.conf&lt;/P&gt;&lt;P&gt;Below stanza is also working , these are just default setting for sourcetype&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[demo]
DATETIME_CONFIG = 
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
category = Custom
pulldown_type = true&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 16:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591112#M205796</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2022-03-28T16:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction using transform</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591115#M205799</link>
      <description>&lt;P&gt;Sorry, but I have to disagree here.&lt;/P&gt;&lt;P&gt;If you can, tell splunk as much as you know. And telling splunk the explicit time format and position is one of the most (if not the most) important things in making inputs quicker. Don't leave splunk guessing. I know that in low-volume environments it might work but once you hit several thousands EPS levels, you want all the performace you can get (and you want to avoid ambiguities).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 16:36:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-field-extraction-using-transform/m-p/591115#M205799</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-03-28T16:36:00Z</dc:date>
    </item>
  </channel>
</rss>

