<?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 add header field to an inputlookup CSV without header in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-header-field-to-an-inputlookup-CSV-without-header/m-p/308586#M93027</link>
    <description>&lt;P&gt;Pretty cool. thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Apr 2017 06:46:35 GMT</pubDate>
    <dc:creator>wiggler</dc:creator>
    <dc:date>2017-04-03T06:46:35Z</dc:date>
    <item>
      <title>how to add header field to an inputlookup CSV without header</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-header-field-to-an-inputlookup-CSV-without-header/m-p/308584#M93025</link>
      <description>&lt;P&gt;Hi guys, I am wondering if it is possible to add a header field to search result if the CSV source doesn't have a header?&lt;/P&gt;

&lt;P&gt;I know that props.conf is needed to setup but I am hoping that it can be done without making any change on the config.&lt;/P&gt;

&lt;P&gt;Let say my CSV is something like this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE&gt;user1, google.com, 2002, 23:32:08&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and if I do a search "| inputlookup filename.csv" it shows the results as a field name instead of the results.&lt;/P&gt;

&lt;P&gt;so I want to have something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt; username      website    hits date
&amp;gt; user1         google.com 2002 23:32:08
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 04:36:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-header-field-to-an-inputlookup-CSV-without-header/m-p/308584#M93025</guid>
      <dc:creator>wiggler</dc:creator>
      <dc:date>2017-04-03T04:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to add header field to an inputlookup CSV without header</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-header-field-to-an-inputlookup-CSV-without-header/m-p/308585#M93026</link>
      <description>&lt;P&gt;If your file only has 1 line then the &lt;CODE&gt;inputcsv&lt;/CODE&gt; will fail entirely so I am assuming that you did not mean that.  If it has more than one line and is missing the header line such that &lt;CODE&gt;inputcsv&lt;/CODE&gt; misinterprets the first line of data as the header, then you can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv eraseme.csv | transpose | transpose | fields - column | rename "row 1" AS year "row 2" AS time "row 3" AS domain "row 4" AS user | outputcsv eraseme.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The super-irritating this is that you cannot control the alphabetical sorting of the columns.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 05:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-header-field-to-an-inputlookup-CSV-without-header/m-p/308585#M93026</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-03T05:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to add header field to an inputlookup CSV without header</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-header-field-to-an-inputlookup-CSV-without-header/m-p/308586#M93027</link>
      <description>&lt;P&gt;Pretty cool. thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 06:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-header-field-to-an-inputlookup-CSV-without-header/m-p/308586#M93027</guid>
      <dc:creator>wiggler</dc:creator>
      <dc:date>2017-04-03T06:46:35Z</dc:date>
    </item>
  </channel>
</rss>

