<?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: Why are my headers being indexed from my csv file? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177549#M35575</link>
    <description>&lt;P&gt;Yep, I've tried that, and headers are still being indexed.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2015 11:48:38 GMT</pubDate>
    <dc:creator>lquinn</dc:creator>
    <dc:date>2015-03-16T11:48:38Z</dc:date>
    <item>
      <title>Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177547#M35573</link>
      <description>&lt;P&gt;I am trying to do a simple monitor data input of a csv file with the following format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Id,User,Action,_time,Comment
 6783493,Laura,Purchase,1426503622.15467,Some Comment
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried several different configurations but each time the headers get indexed! The csv file changes when a saved search runs and outputs the csv. The headers never change. Can anyone tell me what I'm doing wrong? Surely just the standard csv sourcetype should do the trick? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 11:08:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177547#M35573</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-16T11:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177548#M35574</link>
      <description>&lt;P&gt;Did you try to use &lt;/P&gt;

&lt;P&gt;index_extractions = csv      and &lt;BR /&gt;
header_field_line_number = 1 for this source type?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime#Props.conf_attributes_for_structured_data" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime#Props.conf_attributes_for_structured_data&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:13:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177548#M35574</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2020-09-28T19:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177549#M35575</link>
      <description>&lt;P&gt;Yep, I've tried that, and headers are still being indexed.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 11:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177549#M35575</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-16T11:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177550#M35576</link>
      <description>&lt;P&gt;The strange thing is that the headers are being extracted as field names but also as values. So I have User as a field value for User!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 11:50:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177550#M35576</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-16T11:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177551#M35577</link>
      <description>&lt;P&gt;I've just created a brand new csv and indexed it with the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf
[indexed_extractions_test]
HEADER_FIELD_LINE_NUMBER=1
FIELD_DELIMITER=,
INDEXED_EXTRACTION = csv

csv-
os,range
AIX:Version,aix
FreeBSD:Version,freebsd
HPUX:Version,hpux
Linux:Version,linux
OSX:Version,osx
Solaris:Version,solaris
Unix:Version,unix
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;$splunk_home/bin/splunk add oneshot -index main -sourcetype indexed_extractions_test&lt;/P&gt;

&lt;P&gt;The results are accurate. CSV is indexed without the header, and I have KV pairs for  os=*:Version and range=solaris etc.&lt;/P&gt;

&lt;P&gt;Make sure you are deleting the old indexed data before rerunning it.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177551#M35577</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2020-09-28T19:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177552#M35578</link>
      <description>&lt;P&gt;I've worked out that I don't think it is the configurations at all. I can also index a csv and it works fine but when I overwrite it with my search, that is when it starts indexing the headers. &lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 13:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177552#M35578</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-16T13:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177553#M35579</link>
      <description>&lt;P&gt;What are you doing in your search? Also note that _time is a reserved field. So using this fieldname could create problems.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 13:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177553#M35579</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-03-16T13:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177554#M35580</link>
      <description>&lt;P&gt;Thats what I'm thinking too, I'm going to try a few things and I will let you know!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 13:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177554#M35580</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-16T13:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177555#M35581</link>
      <description>&lt;P&gt;I've sorted it, thanks very much for your help! Sometimes you just need a bit of inspiration!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 13:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177555#M35581</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-16T13:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177556#M35582</link>
      <description>&lt;P&gt;The search that I was using to populate my csv, extracted the header fields using the rex command. For some reason when I then wrote over the monitored csv, this caused it to index the headers. I changed my search so that the header fields were extracted in props.conf rather than in the search string and the headers stopped being indexed! Not sure exactly why this was but there you go!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 13:24:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177556#M35582</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-16T13:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177557#M35583</link>
      <description>&lt;P&gt;Please let us know what you encountered, might help others down the road!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 13:25:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177557#M35583</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-03-16T13:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177558#M35584</link>
      <description>&lt;P&gt;same here.  bug?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2015 14:49:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177558#M35584</guid>
      <dc:creator>proletariat99</dc:creator>
      <dc:date>2015-06-29T14:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my headers being indexed from my csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177559#M35585</link>
      <description>&lt;P&gt;Sooo... I've been battling this same thing off and on for the last couple of years.  I've learned a few things that might help.  First, you have to decide whether you're indexing all extracted fields (not recomended) or if you're doing search time field extractions.  What happens to me is that I always test my extractions on a standalone box and it works like a champ and then everything breaks down in our distributed prod / uat environment.  Regardless, this might help:&lt;/P&gt;

&lt;P&gt;For search-time extractions, most of the relevant props.conf entries will be on the search head.  The indexer will only have settings associated with index-timey things (like timestamp, linemerge, line breaker, host, sourcetype, etc -- all the lightweight schema stuff).  On the SH, though, you can use a combination of these settings to do the extractions from the header:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CHECK_FOR_HEADER = TRUE
HEADER_FIELD_LINE_NUMBER = &amp;lt;NUMBER&amp;gt; (this one is cranky and unreliable, but sometimes works)
KV_MODE = &amp;lt;CSV, JSON, XML, etc&amp;gt;  (this one is also cranky and unreliable, especially with xml)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and if you want to be explicit (recommended in a lot of cases), you can use REPORT&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REPORT-name-of-report = name_of_transforms.conf_stanza
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then transforms.conf on the search head will look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[name_of_transforms.conf_stanza]
DELIMS = ","
FIELDS = field1, field2, field3, etc... (these values match the values in the header IDENTICALLY)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Soooo... while this is pretty recommended for a large-scale distributed environment, it doesn't work well a lot of the time because of the relationship between line breakers and timestamp extractions on the indexers and the search head .conf files.  Essentially, you set it all up, you think it should work and then it doesn't (but it did on a standalone)... then troubleshooting sucks.&lt;/P&gt;

&lt;P&gt;For index-time extractions, you can use a combination of the following settings:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;INDEXED_EXTRACTIONS = &amp;lt;blah&amp;gt;
PREAMBLE_REGEX = &amp;lt;match some pattern in the header&amp;gt;  (this actually ignores the first line, but uses it for the field names.)  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if you use PREAMBLE_REGEX, but want search time extractions, you can't (because that line is ignored by the time the search head sees it.).&lt;/P&gt;

&lt;P&gt;Another method of troubleshooting, even if you don't plan on indexed extractions, is to turn on &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;INDEXED_EXTRACTIONS = csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To see if it's your extractions on the SH or something else that's causing the problem.&lt;/P&gt;

&lt;P&gt;And then there's the fishbucket :)... but that's another story... the hits just keep on coming...&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 17:24:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-my-headers-being-indexed-from-my-csv-file/m-p/177559#M35585</guid>
      <dc:creator>proletariat99</dc:creator>
      <dc:date>2016-02-09T17:24:57Z</dc:date>
    </item>
  </channel>
</rss>

