<?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 is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244474#M47288</link>
    <description>&lt;P&gt;Try setting the following in the props.conf for the CSV:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CHECK_FOR_HEADER = true
HEADER_FIELD_LINE_NUMBER = 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've had to set these before for CSV files where the header does &lt;STRONG&gt;not&lt;/STRONG&gt; appear on the first line. It could be you have some extraneous invisible characters at the beginning of the file that the parser is not handling.&lt;/P&gt;

&lt;P&gt;If that doesn't do it, then check that your line break after the header is correct for your OS using a hex editor or similar tool.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2015 20:58:31 GMT</pubDate>
    <dc:creator>nnmiller</dc:creator>
    <dc:date>2015-09-29T20:58:31Z</dc:date>
    <item>
      <title>Why is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244469#M47283</link>
      <description>&lt;P&gt;I'm trying to parse a CSV file, but I'm getting two events: one with a header and one with a raw event. It is driving me nuts.  I've tried deleting and reloading the data multiple times. The file has 2 lines, so at least it is small.&lt;/P&gt;

&lt;P&gt;The file is being loaded via a CLI:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk add oneshot &amp;lt;filename&amp;gt; -sourcetype backtestMetaData -index grb_test
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On my server, props.conf in ./etc/apps/&amp;lt;app_name&amp;gt;/local/props.conf&lt;BR /&gt;
I've looked for 'backtest' in other props.conf files, but don't see any.  Nothing special on the forwarder.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ backtestMetaData]
INDEXED_EXTRACTIONS = csv
KV_MODE = none
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIMESTAMP_FIELDS = startTime
category = Structured
description = format for csv from testREsutls.csv
disabled = false
pulldown_type = true

[source::.../testResults.csv]
sourcetype=backtestMetaData
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2015 02:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244469#M47283</guid>
      <dc:creator>gbronner_rbc</dc:creator>
      <dc:date>2015-09-29T02:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244470#M47284</link>
      <description>&lt;P&gt;Interestingly, it works when I use the web API, but not from the universal forwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244470#M47284</guid>
      <dc:creator>gbronner_rbc</dc:creator>
      <dc:date>2015-09-29T13:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244471#M47285</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;-bash-4.1$ /app/wwd0dev/splunk/bin/splunk btool props list &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;anyone know if the max distance overrides the TIMESTAMP_FIELD?&lt;/P&gt;

&lt;P&gt;backtestMetaData --user=gbronner --app=backtest&lt;BR /&gt;
[backtestMetaData]&lt;BR /&gt;
ANNOTATE_PUNCT = True&lt;BR /&gt;
AUTO_KV_JSON = true&lt;BR /&gt;
BREAK_ONLY_BEFORE =&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE = True&lt;BR /&gt;
CHARSET = UTF-8&lt;BR /&gt;
DATETIME_CONFIG = /etc/datetime.xml&lt;BR /&gt;
HEADER_MODE =&lt;BR /&gt;
INDEXED_EXTRACTIONS = csv&lt;BR /&gt;
KV_MODE = none&lt;BR /&gt;
LEARN_SOURCETYPE = true&lt;BR /&gt;
LINE_BREAKER_LOOKBEHIND = 100&lt;BR /&gt;
MAX_DAYS_AGO = 2000&lt;BR /&gt;
MAX_DAYS_HENCE = 2&lt;BR /&gt;
MAX_DIFF_SECS_AGO = 3600&lt;BR /&gt;
MAX_DIFF_SECS_HENCE = 604800&lt;BR /&gt;
MAX_EVENTS = 256&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 128&lt;BR /&gt;
MUST_BREAK_AFTER =&lt;BR /&gt;
MUST_NOT_BREAK_AFTER =&lt;BR /&gt;
MUST_NOT_BREAK_BEFORE =&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
SEGMENTATION = indexing&lt;BR /&gt;
SEGMENTATION-all = full&lt;BR /&gt;
SEGMENTATION-inner = inner&lt;BR /&gt;
SEGMENTATION-outer = outer&lt;BR /&gt;
SEGMENTATION-raw = none&lt;BR /&gt;
SEGMENTATION-standard = standard&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
TIMESTAMP_FIELDS = startTime&lt;BR /&gt;
TRANSFORMS =&lt;BR /&gt;
TRUNCATE = 10000&lt;BR /&gt;
category = Custom&lt;BR /&gt;
description = format for csv from testREsutls.csv&lt;BR /&gt;
detect_trailing_nulls = false&lt;BR /&gt;
disabled = false&lt;BR /&gt;
maxDist = 100&lt;BR /&gt;
priority =&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
sourcetype =&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244471#M47285</guid>
      <dc:creator>gbronner_rbc</dc:creator>
      <dc:date>2020-09-29T07:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244472#M47286</link>
      <description>&lt;P&gt;I ran into a similar problem that was solved by adding a stanza to transforms.conf that ignores the header row, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [setheadernull]
    REGEX = ^(Header1   Header2   Header3)
    DEST_KEY = queue
    FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2015 19:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244472#M47286</guid>
      <dc:creator>det0n8r</dc:creator>
      <dc:date>2015-09-29T19:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244473#M47287</link>
      <description>&lt;P&gt;Interestingly,  adding a oneshot with &lt;EM&gt;no&lt;/EM&gt; sourcetype results in the file getting parsed as a CSV, which is nice except that it misses my custom TIMESTAMP_FIELD&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 19:45:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244473#M47287</guid>
      <dc:creator>gbronner_rbc</dc:creator>
      <dc:date>2015-09-29T19:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244474#M47288</link>
      <description>&lt;P&gt;Try setting the following in the props.conf for the CSV:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CHECK_FOR_HEADER = true
HEADER_FIELD_LINE_NUMBER = 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've had to set these before for CSV files where the header does &lt;STRONG&gt;not&lt;/STRONG&gt; appear on the first line. It could be you have some extraneous invisible characters at the beginning of the file that the parser is not handling.&lt;/P&gt;

&lt;P&gt;If that doesn't do it, then check that your line break after the header is correct for your OS using a hex editor or similar tool.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 20:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244474#M47288</guid>
      <dc:creator>nnmiller</dc:creator>
      <dc:date>2015-09-29T20:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my sourcetype not parsing as CSV and am getting two events: one with a header and one with a raw event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244475#M47289</link>
      <description>&lt;P&gt;It appears that when loading data from a universal forwarder when the data is header structured (e.g. CSV, TSV), one must edit &lt;CODE&gt;props.conf&lt;/CODE&gt; on the &lt;EM&gt;forwarder&lt;/EM&gt; in order to tell splunk that the sourcetype has to be handled differently.&lt;/P&gt;

&lt;P&gt;Example is:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[backtestMetaData]&lt;BR /&gt;
INDEXED_EXTRACTIONS = csv&lt;BR /&gt;
NO_BINARY_CHECK = 1&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;However, the settings will be slightly different from the &lt;CODE&gt;props.conf&lt;/CODE&gt; on the indexer, which may need to apply custom timestamp rules.&lt;/P&gt;

&lt;P&gt;I found this document to be a a very useful explanation of the process; &lt;BR /&gt;
&lt;A href="https://wiki.splunk.com/Community:HowIndexingWorks" target="_blank"&gt;https://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This question was also useful:&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/153488/does-a-universal-forwarder-ever-read-props-conf.html" target="_blank"&gt;http://answers.splunk.com/answers/153488/does-a-universal-forwarder-ever-read-props-conf.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:24:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-sourcetype-not-parsing-as-CSV-and-am-getting-two/m-p/244475#M47289</guid>
      <dc:creator>gbronner_rbc</dc:creator>
      <dc:date>2020-09-29T07:24:50Z</dc:date>
    </item>
  </channel>
</rss>

