<?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: csv file header (1st tow) field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236878#M176544</link>
    <description>&lt;P&gt;It should work like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ mycsv ]
CHARSET=AUTO
INDEXED_EXTRACTIONS=csv
KV_MODE=none
SHOULD_LINEMERGE=false
category=Structured
disabled=false
pulldown_type=true
HEADER_FIELD_LINE_NUMBER=1
FIELD_DELIMITER=,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you give an example of your csv, inputs.conf and props.conf?&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2016 11:25:37 GMT</pubDate>
    <dc:creator>PPape</dc:creator>
    <dc:date>2016-10-07T11:25:37Z</dc:date>
    <item>
      <title>csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236876#M176542</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a csv file in below format,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date,time,rundate
02/09/2016,00:00.0,02/07/2016
02/09/2016,00:00.0,02/07/2016
02/09/2016,00:00.0,02/07/2016
02/09/2016,00:00.0,02/07/2016
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What should be the props.conf on indexers look like, so that each item in first row (separated by ,) should come as fields and items under that get indexed under that fields name?&lt;/P&gt;

&lt;P&gt;Already tried,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype-name]
INDEXED_EXTRACTIONS = csv
HEADER_FIELD_LINE_NUMBER = 1
HEADER_FIELD_DELIMITER = ,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Simon Mandy&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 11:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236876#M176542</guid>
      <dc:creator>sim_tcr</dc:creator>
      <dc:date>2016-10-07T11:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236877#M176543</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ csv ]
SHOULD_LINEMERGE=false
INDEXED_EXTRACTIONS=csv
TIMESTAMP_FIELDS=rundate,time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Oct 2016 11:23:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236877#M176543</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-07T11:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236878#M176544</link>
      <description>&lt;P&gt;It should work like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ mycsv ]
CHARSET=AUTO
INDEXED_EXTRACTIONS=csv
KV_MODE=none
SHOULD_LINEMERGE=false
category=Structured
disabled=false
pulldown_type=true
HEADER_FIELD_LINE_NUMBER=1
FIELD_DELIMITER=,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you give an example of your csv, inputs.conf and props.conf?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 11:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236878#M176544</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-10-07T11:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236879#M176545</link>
      <description>&lt;P&gt;It did not work&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://L:\Logs\csv\*.csv]
sourcetype = uow_fitcap_csv
index = sandbox
disabled = false
crcSalt=&amp;lt;SOURCE&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;outputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ uow_fitcap_csv  ]
CHARSET=AUTO
INDEXED_EXTRACTIONS=csv
KV_MODE=none
SHOULD_LINEMERGE=false
category=Structured
disabled=false
pulldown_type=true
HEADER_FIELD_LINE_NUMBER=1
FIELD_DELIMITER=,
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Oct 2016 11:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236879#M176545</guid>
      <dc:creator>sim_tcr</dc:creator>
      <dc:date>2016-10-07T11:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236880#M176546</link>
      <description>&lt;P&gt;wich version of splunk are you running?&lt;/P&gt;

&lt;P&gt;and is it your outputs.conf or props.conf?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 11:51:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236880#M176546</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-10-07T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236881#M176547</link>
      <description>&lt;P&gt;we are on 6.3.3&lt;BR /&gt;
mistakenly said outputs.conf, it is props.conf&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 11:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236881#M176547</guid>
      <dc:creator>sim_tcr</dc:creator>
      <dc:date>2016-10-07T11:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236882#M176548</link>
      <description>&lt;P&gt;Is the time really HH:MM.M? There is no strptime variable for MM.M, so the best you're going to get is HH:MM&lt;/P&gt;

&lt;P&gt;ex: strptime cannot compute 00:00.5 = 00:00:30, you can get 00:00.5 to represent as 00:00:05 but that is not accurate.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 16:26:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236882#M176548</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2016-10-07T16:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236883#M176549</link>
      <description>&lt;P&gt;I tested this log file content:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date,time,rundate
02/09/2016,00:00.0,2/07/2016
02/09/2016,00:00.1,2/07/2016
02/09/2016,00:00.2,2/07/2016
02/09/2016,00:00.3,2/07/2016
02/09/2016,00:00.4,2/07/2016
02/09/2016,00:00.5,2/07/2016
02/09/2016,00:00.6,2/07/2016
02/09/2016,00:00.7,2/07/2016
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With these config files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;inputs.conf
[monitor://C:\temp\Splunk\test\csv-test\csv-test3.csv]
disabled = false
index = test
sourcetype = csvtest3

props.conf
[csvtest3]
NO_BINARY_CHECK = true
category = Custom
disabled = false
pulldown_type = true
REPORT-csvtest3 = REPORT-csvtest3

transforms.conf
[REPORT-csvtest3]
DELIMS = ","
FIELDS = "Date","Time","runDate"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Everything works fine, with the exception of the fractional minutes - strptime cannot compute HH:MM.M so you will get HH:MM:SS.SSS truncated to MM as _time for each event, i.e. log time 12:00.9 will equal event time 12:00:00.000.&lt;/P&gt;

&lt;P&gt;If seconds are important, then you should ask another question on how to convert the Time field (string value extracted above) in a search to a time value that includes accurate seconds for sorting purposes.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 17:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236883#M176549</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2016-10-07T17:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: csv file header (1st tow) field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236884#M176550</link>
      <description>&lt;P&gt;Note that this &lt;CODE&gt;props.conf&lt;/CODE&gt; must be deployed TO THE FORWARDER, not to the indexers because &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; is a &lt;EM&gt;very&lt;/EM&gt; special case.&lt;/P&gt;

&lt;P&gt;Perhaps you are misunderstanding how to verify if "it works".  Once this goes to the forwarders and all of the splunk instances there have been bounced, ONLY events forwarded/indexed &lt;EM&gt;after&lt;/EM&gt; the restart will be using the new configurations; previous data will stay wrong forever.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2016 21:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-file-header-1st-tow-field-extraction/m-p/236884#M176550</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-10-08T21:05:52Z</dc:date>
    </item>
  </channel>
</rss>

