<?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 Populate header as field in each row in CSV file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Populate-header-as-field-in-each-row-in-CSV-file/m-p/123527#M25497</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to index a csv file, the data looks like&lt;/P&gt;

&lt;P&gt;"ID","Name","hiredate"&lt;BR /&gt;
"1","John","01-12-2014"&lt;BR /&gt;
"2","Bob","01-12-2014"&lt;BR /&gt;
"3","Mary","01-12-2014"&lt;/P&gt;

&lt;P&gt;When the data is indexed i want to see the data like:&lt;/P&gt;

&lt;P&gt;ID=1,Name=John,hiredate=01-12-2014&lt;BR /&gt;
ID=2,Name=Bob,hiredate=01-12-2014&lt;BR /&gt;
ID=3,Name=Mary,hiredate=01-12-2014&lt;/P&gt;

&lt;P&gt;Is there a way to this, currntly the data in index looks like&lt;/P&gt;

&lt;P&gt;1,John,01-12-2014&lt;/P&gt;

&lt;P&gt;2,Bob,01-12-2014&lt;/P&gt;

&lt;P&gt;3,Mary,01-12-2014&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2014 19:28:52 GMT</pubDate>
    <dc:creator>surendrarhi</dc:creator>
    <dc:date>2014-01-23T19:28:52Z</dc:date>
    <item>
      <title>Populate header as field in each row in CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Populate-header-as-field-in-each-row-in-CSV-file/m-p/123527#M25497</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to index a csv file, the data looks like&lt;/P&gt;

&lt;P&gt;"ID","Name","hiredate"&lt;BR /&gt;
"1","John","01-12-2014"&lt;BR /&gt;
"2","Bob","01-12-2014"&lt;BR /&gt;
"3","Mary","01-12-2014"&lt;/P&gt;

&lt;P&gt;When the data is indexed i want to see the data like:&lt;/P&gt;

&lt;P&gt;ID=1,Name=John,hiredate=01-12-2014&lt;BR /&gt;
ID=2,Name=Bob,hiredate=01-12-2014&lt;BR /&gt;
ID=3,Name=Mary,hiredate=01-12-2014&lt;/P&gt;

&lt;P&gt;Is there a way to this, currntly the data in index looks like&lt;/P&gt;

&lt;P&gt;1,John,01-12-2014&lt;/P&gt;

&lt;P&gt;2,Bob,01-12-2014&lt;/P&gt;

&lt;P&gt;3,Mary,01-12-2014&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2014 19:28:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Populate-header-as-field-in-each-row-in-CSV-file/m-p/123527#M25497</guid>
      <dc:creator>surendrarhi</dc:creator>
      <dc:date>2014-01-23T19:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Populate header as field in each row in CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Populate-header-as-field-in-each-row-in-CSV-file/m-p/123528#M25498</link>
      <description>&lt;P&gt;No but I assume you want the "=" in the event to make search-time auto key-value extraction work.  Use this instead:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Put this in props.conf&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;INDEXED_EXTRACTIONS=CSV&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then in the Splunk Search field picker you will see:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://answers.splunk.com//storage/Screen_Shot_2014-02-13_at_10.46.21_AM.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;And you can show the fields in the events if you want:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://answers.splunk.com//storage/Screen_Shot_2014-02-13_at_10.48.02_AM.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2014 15:48:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Populate-header-as-field-in-each-row-in-CSV-file/m-p/123528#M25498</guid>
      <dc:creator>ogdin</dc:creator>
      <dc:date>2014-02-13T15:48:41Z</dc:date>
    </item>
  </channel>
</rss>

