<?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: Simple CSV input problem. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312655#M58598</link>
    <description>&lt;P&gt;all good &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; i submitted a comment and not an answer.&lt;BR /&gt;
if it helped, you can up vote my comment&lt;BR /&gt;
glad you figured it out&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2017 18:50:41 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2017-06-02T18:50:41Z</dc:date>
    <item>
      <title>Simple CSV input problem.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312651#M58594</link>
      <description>&lt;P&gt;Looking for some help with a simple csv input. I will show my inputs.conf, props.conf, transforms.conf, and example csv files below. Everything is working fine except for 1 small issue. See details below:&lt;/P&gt;

&lt;P&gt;I have an input monitoring a directory for an csv file. The csv file has 2 lines of garbage header info, the file also has some field values which contain commas (which the csv generator places double quotes around the entire field), and some of the lines begin with an empty field (which means the first character is a comma, delimiting to the second field). Also, the csv has a total of 11 fields, of which the last 3 are empty, and I am only extracting the first 8.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;All field extractions are happening perfectly with one exception&lt;/STRONG&gt;: on lines which have an empty first field (therefore start with a comma), the first field is not extracted with a value of null(), it's extracted with a comma and then data from the succeeding fields. The remaining fields on that line are extracted correctly, though.&lt;/P&gt;

&lt;P&gt;Long story short, I would like lines which have no value in field_1, to be extracted as null(), or NULL or something like that. I've attempted adding "KEEP_EMPTY_VALS = true" to the transforms.conf, with no change in results.&lt;/P&gt;

&lt;P&gt;Any help is greatly appreciated. Thanks!&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:D:\Logs\mydirectory]
disabled = false
index = myindex
sourcetype = mysourcetype
whitelist = myfile.+\.csv
ignoreOlderThan = 14d
crcSalt = &amp;lt;SOURCE&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
DATETIME_CONFIG = CURRENT
description = my description goes here
LINE_BREAKER = ([\r\n]+)
SHOULD_LINEMERGE = false
TZ = US/Eastern
TRANSFORMS-ignore_myheader1 = ignore_myheader1
TRANSFORMS-ignore_myheader2 = ignore_myheader2
REPORT-my_extract = my_extractions
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_extractions]
DELIMS = ","
FIELDS =  "field_1", "field_2", "field_3", "field_4", "field_5", "field_6", "field_7", "field_8"

[ignore_myheader1]
# Stanza that ignores the first line of file
REGEX = plain text in myheader1 to be dicarded
DEST_KEY = queue
FORMAT = nullQueue

[ignore_myheader2]
# Stanza that ignores the second line of file
REGEX = plain text in myheader2 to be discarded
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;myfileexample.csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;plain text in myheader1 to be dicarded,field_2,field_3,field_4,field_5,field_6,field_7,field_8,field_9,field_10,field_11
plain text in myheader2 to be dicarded,field_2,field_3,field_4,field_5,field_6,field_7,field_8,field_9,field_10,field_11
,field_2,field_3,field_4,field_5,field_6,field_7,field_8,,,
,field_2,field_3,field_4,field_5,field_6,field_7,field_8,,,
,field_2,field_3,field_4,field_5,field_6,field_7,field_8,,,
field_1,field_2,field_3,field_4,field_5,field_6,field_7,field_8,,,
field_1,field_2,field_3,field_4,field_5,field_6,field_7,field_8,,,
field_1,field_2,field_3,field_4,field_5,field_6,field_7,field_8,,,
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:12:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312651#M58594</guid>
      <dc:creator>adamsmith47</dc:creator>
      <dc:date>2020-09-29T14:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simple CSV input problem.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312652#M58595</link>
      <description>&lt;P&gt;hello there,&lt;BR /&gt;
kindly check this doc:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.0/Data/Extractfieldsfromfileswithstructureddata"&gt;http://docs.splunk.com/Documentation/Splunk/6.6.0/Data/Extractfieldsfromfileswithstructureddata&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 14:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312652#M58595</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-05-26T14:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple CSV input problem.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312653#M58596</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;

&lt;P&gt;I attempted INDEXED_EXTRACTIONS = CSV and related setting already, but reading the document you linked, I learned these would need to take place on the forwarder (I placed them at the indexer, when I attempted). When I have time I will try it out and reply here will results.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 14:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312653#M58596</guid>
      <dc:creator>adamsmith47</dc:creator>
      <dc:date>2017-05-26T14:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Simple CSV input problem.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312654#M58597</link>
      <description>&lt;P&gt;Thank you, the documentation was helpful, and addressed my issue.&lt;/P&gt;

&lt;P&gt;I would accept your answer as correct, but, I can't find how to do that. Didn't there used to be a button for that?!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 18:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312654#M58597</guid>
      <dc:creator>adamsmith47</dc:creator>
      <dc:date>2017-06-02T18:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Simple CSV input problem.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312655#M58598</link>
      <description>&lt;P&gt;all good &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; i submitted a comment and not an answer.&lt;BR /&gt;
if it helped, you can up vote my comment&lt;BR /&gt;
glad you figured it out&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 18:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Simple-CSV-input-problem/m-p/312655#M58598</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-06-02T18:50:41Z</dc:date>
    </item>
  </channel>
</rss>

