<?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: &amp;quot;Corrupt csv header&amp;quot; : how to find the corrupted csv? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216106#M63394</link>
    <description>&lt;P&gt;another quick and easy solution if you know which lookup it is - use Splunk search commands to clean it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | inputlookup lookupName | outputlookup lookupName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Thu, 03 Dec 2015 00:43:48 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2015-12-03T00:43:48Z</dc:date>
    <item>
      <title>"Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216101#M63389</link>
      <description>&lt;P&gt;I find on splunkd.log a lot of warnings as: "Corrupt csv header, contains empty value (col #3)" without any other details.&lt;BR /&gt;
I have many .csv and many automated lookups in my Splunk. How can I find the corrupted one without opening all of them with a spreadsheet?&lt;/P&gt;

&lt;P&gt;Thank you to all in advance&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 14:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216101#M63389</guid>
      <dc:creator>mekamundia</dc:creator>
      <dc:date>2015-09-08T14:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216102#M63390</link>
      <description>&lt;P&gt;Assuming that your OS is unix/linux, assuming that your CSV files use standard filenaming conventions (i.e. &lt;CODE&gt;*.csv&lt;/CODE&gt;), assuming that your CSV files are standard with a header on the first line, assuming that the source files still exist, you can use the following CLI commands to identify problematic files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;find . -name "*.csv" -exec echo {} \; -exec grep -n ",," {} \; | grep -B 1 "^1:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This variation also considers whitespace but may not be compatible with your version of &lt;CODE&gt;grep&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;find . -name "*.csv" -exec echo {} \; -exec grep -Pn ",\s*," {} \; | grep -B 1 "^1:"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Sep 2015 15:04:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216102#M63390</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-09-08T15:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216103#M63391</link>
      <description>&lt;P&gt;good way! finded! thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 15:24:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216103#M63391</guid>
      <dc:creator>mekamundia</dc:creator>
      <dc:date>2015-09-08T15:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216104#M63392</link>
      <description>&lt;P&gt;Just spent hours trying this; it was an error in the header BUT it was at the END of the header...that is the first line ended with a comma ",". Grep for this also:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;find . -name "*.csv" -exec echo {} \; -exec grep -Pn ",$" {} \; | grep -B 1 "^1:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Looks for a comma at the END of the line in the first line.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 21:09:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216104#M63392</guid>
      <dc:creator>kapanig</dc:creator>
      <dc:date>2015-10-07T21:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216105#M63393</link>
      <description>&lt;P&gt;This finds everything in 1 search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;find . -name "*.csv" -exec echo {} \; -exec egrep -Pn "^\s*,|,\s*,|,\s*$" {} \; | grep -B 1 "^1:"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2015 15:31:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216105#M63393</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-08T15:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216106#M63394</link>
      <description>&lt;P&gt;another quick and easy solution if you know which lookup it is - use Splunk search commands to clean it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | inputlookup lookupName | outputlookup lookupName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2015 00:43:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216106#M63394</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-12-03T00:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216107#M63395</link>
      <description>&lt;P&gt;This may drop rows or mis-align fields with headers, depending on the type of problem.  I would rather hand-manage the cleanup.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2015 17:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216107#M63395</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-12-03T17:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216108#M63396</link>
      <description>&lt;P&gt;This is true, if the problematic header misses a field some where in the header and not at the end - but then you have other problems and were missing those fields anyway.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2015 20:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216108#M63396</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-12-06T20:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216109#M63397</link>
      <description>&lt;P&gt;and to make it match a missing field somewhere in the header AND at the end run this &lt;CODE&gt;find&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;find . -name "*.csv" -exec echo {} \; -exec grep -Pn ',$|,,' {} \; | grep -B 1 "^1:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Still have to figure out how this can be done by Splunk Admin without CLI OS access though......&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2015 20:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216109#M63397</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-12-06T20:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216110#M63398</link>
      <description>&lt;P&gt;Sorry to add another answer; but here is how you do it if your not on Linux or do not have OS access on the search head to run @woodcock 's command.&lt;/P&gt;

&lt;P&gt;Using the Lookup Editor App &lt;A href="https://splunkbase.splunk.com/app/1724/"&gt;https://splunkbase.splunk.com/app/1724/&lt;/A&gt; you can check the lookup files and see the error straight away!&lt;BR /&gt;
I uploaded two lookup files called &lt;CODE&gt;missingoneheaderfield.csv&lt;/CODE&gt; which is missing one header field somewhere in the header and another lookup file called &lt;CODE&gt;missingendheaderfield.csv&lt;/CODE&gt; which - surprise, surprise - misses one field at the end of the header.&lt;/P&gt;

&lt;P&gt;Running the app and looking at the lookup files you can spot and fix the errors very easy.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;missingoneheaderfield.csv&lt;/STRONG&gt;&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/644i7F25D37ED66AD776/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;missingendheaderfield.csv&lt;/STRONG&gt;&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/645i07594B38652E5D47/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope this will help anyone out there to get rid of this annoying error&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 01:22:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216110#M63398</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-12-09T01:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216111#M63399</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Something similar happened to me, we had an TA Addon arista and the  app Arista operating in the Search Head, we found that there was a duplicate word "speed" in a CSV but there was no reference to what lookup it was.&lt;/P&gt;

&lt;P&gt;Error&lt;/P&gt;

&lt;P&gt;"09-19-2019 22:05:14.045 -0500 WARN  SearchResultsCSVSerializer - Corrupt csv header, 2 columns with the same name 'speed' (col #3 and #0, #3 will be ignored)"&lt;/P&gt;

&lt;P&gt;Solution - Find the speed word in the csv files of the splunk apps directory.&lt;/P&gt;

&lt;P&gt;grep -Rw '/opt/splunk/etc/apps/' -e 'speed' --include=*.csv&lt;/P&gt;

&lt;P&gt;Output&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/apps/TA-arista/lookups/interface-speed.csv:speed,"speed_desc",Speed&lt;BR /&gt;
/opt/splunk/etc/apps/aristanetworks/lookups/interface-speed.csv:speed,"speed_desc",speed&lt;/P&gt;

&lt;P&gt;Then delete the app or duplicate csv (In my case delete the app contain csv duplicate)&lt;/P&gt;

&lt;P&gt;/opt/splunk/bin/splunk stop&lt;BR /&gt;
rm -rf /opt/splunk/etc/apps/aristanetworks&lt;BR /&gt;
/opt/splunk/bin/splunk start&lt;/P&gt;

&lt;P&gt;Validate log level (error, warn)&lt;/P&gt;

&lt;P&gt;tail -f tail -f /opt/splunk/var/log/splunk/splunkd.log&lt;/P&gt;

&lt;P&gt;OR  Query SPL&lt;/P&gt;

&lt;P&gt;index="_internal" &lt;BR /&gt;
| search log_level!="info"&lt;BR /&gt;
| stats values(component) count by log_level&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:18:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/216111#M63399</guid>
      <dc:creator>ysposada</dc:creator>
      <dc:date>2020-09-30T02:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/620569#M215730</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you do not know which csv file is causing the issue, how do you manage to locate it?&lt;/P&gt;&lt;P&gt;As we have many lookups, but the error is not mentioning which is causing the error.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Jaspal&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 11:30:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/620569#M215730</guid>
      <dc:creator>jaspal95</dc:creator>
      <dc:date>2022-11-11T11:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: "Corrupt csv header" : how to find the corrupted csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/695477#M236486</link>
      <description>&lt;P&gt;I have created a simple addon on Splunkbase that can identify bad CSV files in your environment:&amp;nbsp;&lt;A href="https://splunkbase.splunk.com/app/7497" target="_blank"&gt;https://splunkbase.splunk.com/app/7497&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 00:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Corrupt-csv-header-quot-how-to-find-the-corrupted-csv/m-p/695477#M236486</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2024-08-07T00:56:57Z</dc:date>
    </item>
  </channel>
</rss>

