<?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 do I add a CSV file as an input to show the header as a field name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398444#M115557</link>
    <description>&lt;P&gt;If you try with query-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;indexname&amp;gt;|table Time, Main_Release, Weekly_Release, Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it should give you expected output.&lt;BR /&gt;
you can see below events are extracted with column header as expected.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5850i4F15C17957B8B232/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 12:35:51 GMT</pubDate>
    <dc:creator>493669</dc:creator>
    <dc:date>2018-10-03T12:35:51Z</dc:date>
    <item>
      <title>How do I add a CSV file as an input to show the header as a field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398443#M115556</link>
      <description>&lt;P&gt;I am trying to add the below CSV file data into Splunk as an input through the ‘Add Data’ section.&lt;BR /&gt;
Time, Main_Release, Weekly_Release, Count&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;01/10/2018, 5.1, 5.1.1, 14
02/10/2018, 5.1, 5.1.2, 20
03/10/2018, 5.2, 5.2.1, 40
04/10/2018, 5.3, 5.3.1, 29
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After adding the data, the events which are showing under my index and source type are as follows&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Event-1 -&amp;gt; 01/10/2018, 5.1, 5.1.1, 14
Event-2 -&amp;gt;02/10/2018, 5.1, 5.1.2, 20
Event-3 -&amp;gt;03/10/2018, 5.2, 5.2.1, 40
Event-4 -&amp;gt;04/10/2018, 5.3, 5.3.1, 29
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But what I am expecting is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Event-1 -&amp;gt; Time=01/10/2018, Main_Release=5.1, Weekly_Release=5.1.1, Count=14
Event-2 -&amp;gt; Time=02/10/2018, Main_Release=5.1, Weekly_Release=5.1.2, Count=20
etc.,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am expecting the header of the CSV file to be the respective fields for each values. But it is giving me only the values available in the CSV file cell.&lt;/P&gt;

&lt;P&gt;Could anyone please help me on this to achieve header as the field name for each events with field values?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:25:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398443#M115556</guid>
      <dc:creator>akarivaratharaj</dc:creator>
      <dc:date>2020-09-29T21:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a CSV file as an input to show the header as a field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398444#M115557</link>
      <description>&lt;P&gt;If you try with query-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;indexname&amp;gt;|table Time, Main_Release, Weekly_Release, Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it should give you expected output.&lt;BR /&gt;
you can see below events are extracted with column header as expected.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5850i4F15C17957B8B232/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 12:35:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398444#M115557</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-10-03T12:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a CSV file as an input to show the header as a field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398445#M115558</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206320"&gt;@493669&lt;/a&gt; ,&lt;/P&gt;

&lt;P&gt;Thanks for your response. In the above method which you mentioned I am able to display my data on dashboard panels.&lt;/P&gt;

&lt;P&gt;But just want to know, is there any other way to index the values with their field names in each events while adding the input file itself.&lt;/P&gt;

&lt;P&gt;Instead of showing the below:&lt;BR /&gt;
Event-1 -&amp;gt; 01/10/2018, 5.1, 5.1.1, 14&lt;BR /&gt;
Event-2 -&amp;gt;02/10/2018, 5.1, 5.1.2, 20&lt;/P&gt;

&lt;P&gt;Can we get in this way:&lt;BR /&gt;
Event-1 -&amp;gt; Time=01/10/2018, Main_Release=5.1, Weekly_Release=5.1.1, Count=14&lt;BR /&gt;
Event-2 -&amp;gt; Time=02/10/2018, Main_Release=5.1, Weekly_Release=5.1.2, Count=20&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398445#M115558</guid>
      <dc:creator>akarivaratharaj</dc:creator>
      <dc:date>2020-09-29T21:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a CSV file as an input to show the header as a field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398446#M115559</link>
      <description>&lt;P&gt;I don't think Splunk will give in such manner but in similar way you can get in table fashion because in events splunk will show as raw i.e. the events present in csv in same way splunk will show&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 04:49:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398446#M115559</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-10-05T04:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a CSV file as an input to show the header as a field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398447#M115560</link>
      <description>&lt;P&gt;Okay got it. Thankyou&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 07:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-CSV-file-as-an-input-to-show-the-header-as-a/m-p/398447#M115560</guid>
      <dc:creator>akarivaratharaj</dc:creator>
      <dc:date>2018-10-05T07:17:20Z</dc:date>
    </item>
  </channel>
</rss>

