<?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 to extract the Fields from .txt file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294326#M93699</link>
    <description>&lt;P&gt;Since your data is already in CSV format, you can enable CSV extraction using the header row as the field names.  Your props.conf should look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ csv_custom ]
DATETIME_CONFIG=NONE
INDEXED_EXTRACTIONS=csv
FIELD_DELIMITER=,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; You will need to distribute this config to the universal forwarders as well, since they need the configuration to correctly read the CSV file.  Are you doing this, or are you only placing the config on the indexer?&lt;/P&gt;

&lt;P&gt;This config appears to work correctly for me (I added the missing &lt;EM&gt;make&lt;/EM&gt; field into the data):&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://i.imgur.com/rNhXGFx.png" alt="CSV Extraction" /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2017 03:33:34 GMT</pubDate>
    <dc:creator>mtulett_splunk</dc:creator>
    <dc:date>2017-11-23T03:33:34Z</dc:date>
    <item>
      <title>How to extract the Fields from .txt file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294325#M93698</link>
      <description>&lt;P&gt;I am indexing Server.txt file from 1000+ forwarders. The file format is as below. I want to extract below header values as field while indexing it. Could someone please suggest what need to be added in props.conf of indexer to extract these fields. I am using splunk version of 6.4&lt;BR /&gt;
ServerName,OSVersion,Make,Uptime,LastReboot (Fields to be extracted)&lt;/P&gt;

&lt;P&gt;ServerName,OSVersion,Make,Uptime,LastReboot&lt;BR /&gt;
Server1,Windows2008 R2,23hrs,10/10/2017&lt;BR /&gt;
Server2,Windows2012 R2,13hrs,11/12/2107&lt;BR /&gt;
Server3,Windows2012 R2,13hrs,11/11/2017&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 03:08:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294325#M93698</guid>
      <dc:creator>pbsuju</dc:creator>
      <dc:date>2017-11-23T03:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the Fields from .txt file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294326#M93699</link>
      <description>&lt;P&gt;Since your data is already in CSV format, you can enable CSV extraction using the header row as the field names.  Your props.conf should look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ csv_custom ]
DATETIME_CONFIG=NONE
INDEXED_EXTRACTIONS=csv
FIELD_DELIMITER=,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; You will need to distribute this config to the universal forwarders as well, since they need the configuration to correctly read the CSV file.  Are you doing this, or are you only placing the config on the indexer?&lt;/P&gt;

&lt;P&gt;This config appears to work correctly for me (I added the missing &lt;EM&gt;make&lt;/EM&gt; field into the data):&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://i.imgur.com/rNhXGFx.png" alt="CSV Extraction" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 03:33:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294326#M93699</guid>
      <dc:creator>mtulett_splunk</dc:creator>
      <dc:date>2017-11-23T03:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the Fields from .txt file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294327#M93700</link>
      <description>&lt;P&gt;I already have below in props.conf of indexer . But I don't see fields getting extracted.&lt;/P&gt;

&lt;P&gt;[server_Input]&lt;BR /&gt;
INDEXED_EXTRACTIONS = CSV&lt;BR /&gt;
FIELD_DELIMITER = ,&lt;BR /&gt;
FIELD_QUOTE = NONE&lt;BR /&gt;
HEADER_FIELD_LINE_NUMBER = 1&lt;BR /&gt;
DATETIME_CONFIG = NONE&lt;BR /&gt;
CHECK_METHOD = modtime&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:52:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294327#M93700</guid>
      <dc:creator>pbsuju</dc:creator>
      <dc:date>2020-09-29T16:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the Fields from .txt file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294328#M93701</link>
      <description>&lt;P&gt;I've updated my answer slightly.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 04:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294328#M93701</guid>
      <dc:creator>mtulett_splunk</dc:creator>
      <dc:date>2017-11-23T04:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the Fields from .txt file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294329#M93702</link>
      <description>&lt;P&gt;Thanks. It worked.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 11:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-Fields-from-txt-file/m-p/294329#M93702</guid>
      <dc:creator>pbsuju</dc:creator>
      <dc:date>2017-11-27T11:31:32Z</dc:date>
    </item>
  </channel>
</rss>

