<?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 skip header in CSV files before indexing? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336209#M99807</link>
    <description>&lt;P&gt;The data above is an example of such file. In the monitored location (/opt/ect/data/sdp/mail/statistics/&lt;EM&gt;SDUP&lt;/EM&gt;.csv) the same kind of file is being exported every 10 minutes (with a different name of course). The header I am speaking off that needs to be skipped is the same structure in every csv file.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 13:19:34 GMT</pubDate>
    <dc:creator>sander_vandamme</dc:creator>
    <dc:date>2017-10-27T13:19:34Z</dc:date>
    <item>
      <title>How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336207#M99805</link>
      <description>&lt;P&gt;My input files are in the following format (CSV):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Icon Statistics

Time;26.10.2017 00:00 - 27.10.2017 04:40
Service;Servicename
Statistic;Report_servicename

Date;Time;IncomingRequest;InternalSystemDBError;InternalSystemDataError;InternalSystemErrorOther;OK;SDUPTimeout;SDUPError;InvalidIncomingRequest;counter8;counter9;counter10;counter11;counter12;counter13;counter14;counter15;counter16;counter17;counter18;counter19
26.10.2017;00:00;4;0;0;0;4;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
26.10.2017;00:10;2;0;0;0;2;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
26.10.2017;00:20;5;0;0;0;5;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
Total;;1,234;0;0;0;1,224;0;10;0;0;0;0;0;0;0;0;0;0;0;0;0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Before indexing these files, the "header" should be removed.&lt;BR /&gt;
I configured the Splunk Universal Forwarder to monitor these files in the following way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///opt/ect/data/sdp/mail/statistics/*SDUP*.csv]
index=csdp_prod_stats
source=statistics
sourcetype=csv
crcSalt = &amp;lt;SOURCE&amp;gt;
ignoreOlderThan=14d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the main Splunk instance, I configured the props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv]
TRANSFORMS-eliminate_header = eliminate_header
INDEXED_EXTRACTIONS = CSV
FIELD_DELIMITER = ;
TIMESTAMP_FIELDS = Date,Time
HEADER_FIELD_LINE_NUMBER = 7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And transforms.conf as following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[eliminate_header]
REGEX = ^(?:Icon|Time|Service|Statistic|Total)
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I check the search in Splunk, it seems like the remove of the header is not working. The complete file is being indexed. What am I doing wrong?&lt;/P&gt;

&lt;P&gt;Also I want to use the column names in the CSV as field names in Splunk from the line I did not remove from the CSV file. Is this the correct way of specifying this automatic extraction of fields in Spunk? ("HEADER_FIELD_LINE_NUMBER = 7" as seen above in props.conf)&lt;/P&gt;

&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:30:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336207#M99805</guid>
      <dc:creator>sander_vandamme</dc:creator>
      <dc:date>2020-09-29T16:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336208#M99806</link>
      <description>&lt;P&gt;is the above example data, a single event or whole contents of a file? Just checking this because if  "Icon Statistics" occur again the same file, it might need line breaker and line merge false options&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 12:57:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336208#M99806</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-10-27T12:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336209#M99807</link>
      <description>&lt;P&gt;The data above is an example of such file. In the monitored location (/opt/ect/data/sdp/mail/statistics/&lt;EM&gt;SDUP&lt;/EM&gt;.csv) the same kind of file is being exported every 10 minutes (with a different name of course). The header I am speaking off that needs to be skipped is the same structure in every csv file.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 13:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336209#M99807</guid>
      <dc:creator>sander_vandamme</dc:creator>
      <dc:date>2017-10-27T13:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336210#M99808</link>
      <description>&lt;P&gt;Hey Sander!&lt;/P&gt;

&lt;P&gt;you need to make sure you put the props/transforms on the forwarder when dealing with structured data:&lt;/P&gt;

&lt;P&gt;"If you want to forward fields that you extract from structured data files to another Splunk instance, you must configure the props.conf settings that define the field extractions on the forwarder that sends the data."&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.0/Data/Extractfieldsfromfileswithstructureddata#Field_extraction_settings_for_forwarded_structured_data_must_be_configured_on_the_forwarder"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.0/Data/Extractfieldsfromfileswithstructureddata#Field_extraction_settings_for_forwarded_structured_data_must_be_configured_on_the_forwarder&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This props worked for me, you should just pick the right timezone (TZ) value for this data, and perhaps just dump the Total line..by providing the header line number , I believe you remove the need for props/transforms to dump the header as we do it automagically I believe:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ sander_csv ]
CHARSET=UTF-8
INDEXED_EXTRACTIONS=csv
KV_MODE=none
SHOULD_LINEMERGE=false
category=Structured
description=Comma-separated value format. Set header and other settings in "Delimited Settings"
disabled=false
pulldown_type=true
HEADER_FIELD_LINE_NUMBER=7
FIELD_DELIMITER=;
TZ=UTC
TIMESTAMP_FIELDS=Date,Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://i.imgur.com/ZinZCg7.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 14:47:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336210#M99808</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-10-27T14:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336211#M99809</link>
      <description>&lt;P&gt;Thank you! This one is working for me. Your proposed props.conf in Combination with the transforms.conf the "Total" line is also skipped from indexing.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 16:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336211#M99809</guid>
      <dc:creator>sander_vandamme</dc:creator>
      <dc:date>2017-10-27T16:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336212#M99810</link>
      <description>&lt;P&gt;sweet, what did it? pushing the props/transforms the forwarder?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:29:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336212#M99810</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-10-27T17:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336213#M99811</link>
      <description>&lt;P&gt;Yes indeed, moved both files to the forwarder and it started to work flawlessly!&lt;BR /&gt;
Thanks once more!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336213#M99811</guid>
      <dc:creator>sander_vandamme</dc:creator>
      <dc:date>2017-10-27T17:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336214#M99812</link>
      <description>&lt;P&gt;Please clarify: when you say "you need to make sure you put the props/transforms on the forwarder", do you mean a forwarding Splunk instance, or do you mean a Splunk Universal Forwarder?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:12:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336214#M99812</guid>
      <dc:creator>DUThibault</dc:creator>
      <dc:date>2018-01-12T16:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336215#M99813</link>
      <description>&lt;P&gt;speaking specifically about indexed_extractions, it would be any forwarding instance. &lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 19:55:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336215#M99813</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2018-01-12T19:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336216#M99814</link>
      <description>&lt;P&gt;So I should copy &lt;CODE&gt;[Splunk Instance]/opt/splunk/etc/apps/search/local/props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; to &lt;CODE&gt;[Splunk Universal Forwarder]/opt/splunkforwarder/etc/apps/_server_app_&amp;lt;server class&amp;gt;/local/&lt;/CODE&gt; , correct?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 20:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336216#M99814</guid>
      <dc:creator>DUThibault</dc:creator>
      <dc:date>2018-01-12T20:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336217#M99815</link>
      <description>&lt;P&gt;hard to say, not sure what you are trying to do. maybe start a new answers post and link me and I'll help you there, or catch me on slack (splk.it/splunk - my username is @mattymo)&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 20:17:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336217#M99815</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2018-01-12T20:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336218#M99816</link>
      <description>&lt;P&gt;How do I "link you"? I don't see anything resembling that on my original question's page.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 20:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336218#M99816</guid>
      <dc:creator>DUThibault</dc:creator>
      <dc:date>2018-01-12T20:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336219#M99817</link>
      <description>&lt;P&gt;just post the link here&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 20:33:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336219#M99817</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2018-01-12T20:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip header in CSV files before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336220#M99818</link>
      <description>&lt;P&gt;See you here: &lt;A href="https://answers.splunk.com/answers/598234/importing-collectd-csv-data-for-consumption-by-spl.html"&gt;https://answers.splunk.com/answers/598234/importing-collectd-csv-data-for-consumption-by-spl.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And thanks for helping me!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 20:52:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-skip-header-in-CSV-files-before-indexing/m-p/336220#M99818</guid>
      <dc:creator>DUThibault</dc:creator>
      <dc:date>2018-01-12T20:52:52Z</dc:date>
    </item>
  </channel>
</rss>

