<?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 Why do we get this error when scheduling a search as a report: &amp;quot;line contains NULL byte&amp;quot;)? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-do-we-get-this-error-when-scheduling-a-search-as-a-report/m-p/462534#M130401</link>
    <description>&lt;P&gt;We have a search that runs fine but when we schedule it as a report, we don't get the e-mail and in &lt;CODE&gt;_internal&lt;/CODE&gt; we see -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05-26-2020 17:10:25.215 -0400 ERROR ScriptRunner - stderr from '/opt/apps/splunk/bin/python /opt/apps/splunk/etc/apps/search/bin/sendemail.py "results_link=https://:8000/app/search/@go?sid=scheduler__myid__search__RMD593055a08ba8cd116_at_1590527400_77786" "ssname=My test" "graceful=True" "trigger_time=1590527424" results_file="/opt/apps/splunk/var/run/splunk/dispatch/scheduler__myid__search__RMD593055a08ba8cd116_at_1590527400_77786/results.csv.gz"':  _csv.Error: line contains NULL byte
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What might be the problem?&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2020 21:16:58 GMT</pubDate>
    <dc:creator>danielbb</dc:creator>
    <dc:date>2020-05-26T21:16:58Z</dc:date>
    <item>
      <title>Why do we get this error when scheduling a search as a report: "line contains NULL byte")?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-do-we-get-this-error-when-scheduling-a-search-as-a-report/m-p/462534#M130401</link>
      <description>&lt;P&gt;We have a search that runs fine but when we schedule it as a report, we don't get the e-mail and in &lt;CODE&gt;_internal&lt;/CODE&gt; we see -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05-26-2020 17:10:25.215 -0400 ERROR ScriptRunner - stderr from '/opt/apps/splunk/bin/python /opt/apps/splunk/etc/apps/search/bin/sendemail.py "results_link=https://:8000/app/search/@go?sid=scheduler__myid__search__RMD593055a08ba8cd116_at_1590527400_77786" "ssname=My test" "graceful=True" "trigger_time=1590527424" results_file="/opt/apps/splunk/var/run/splunk/dispatch/scheduler__myid__search__RMD593055a08ba8cd116_at_1590527400_77786/results.csv.gz"':  _csv.Error: line contains NULL byte
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What might be the problem?&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 21:16:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-do-we-get-this-error-when-scheduling-a-search-as-a-report/m-p/462534#M130401</guid>
      <dc:creator>danielbb</dc:creator>
      <dc:date>2020-05-26T21:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why do we get this error when scheduling a search as a report: "line contains NULL byte")?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-do-we-get-this-error-when-scheduling-a-search-as-a-report/m-p/462535#M130402</link>
      <description>&lt;P&gt;The problem was that the developer inserted the NULL character using SED.&lt;/P&gt;

&lt;P&gt;Before -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex mode=sed s/'//g | rex "session.radius.last.attr.class is (?&amp;lt;radius&amp;gt;\w+)" | rex mode=sed field=radius "s/([0-9A-Fa-f]{2})/%\1/g" | eval radius=urldecode(substr(radius,3)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "session.radius.last.attr.class is (?&amp;lt;radius&amp;gt;\w+)" | rex mode=sed field=radius "s/([0-9A-Fa-f]{2})/%\1/g" | eval radius=urldecode(substr(radius,3)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sed works like &lt;CODE&gt;s/replace-me/with-me/g =&lt;/CODE&gt; that would replace the string "replace-me" with "with-me".  So the top (BEFORE) in the first SED replaced the single quote with nothing (NULL) Character. causing the issue – I didn't realize &lt;CODE&gt;\w+&lt;/CODE&gt; would match NULL bytes. But it certainly did.&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 14:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-do-we-get-this-error-when-scheduling-a-search-as-a-report/m-p/462535#M130402</guid>
      <dc:creator>danielbb</dc:creator>
      <dc:date>2020-05-27T14:02:31Z</dc:date>
    </item>
  </channel>
</rss>

