<?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: Can't use stats with custom streaming searchcommand in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-t-use-stats-with-custom-streaming-searchcommand/m-p/527984#M149050</link>
    <description>&lt;P&gt;Try appending &lt;FONT face="courier new,courier"&gt;| noop&amp;nbsp;log_DEBUG=*&lt;/FONT&gt; to the search.&amp;nbsp; Then check the search log for debug messages that may help determine the cause of the error.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 18:04:58 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-11-04T18:04:58Z</dc:date>
    <item>
      <title>Can't use stats with custom streaming searchcommand</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-use-stats-with-custom-streaming-searchcommand/m-p/527980#M149048</link>
      <description>&lt;P&gt;I have a custom search command that extracts a domain name from a url string field you specify into a new "domain" field. This works fine on a dev cluster we have setup (3 search heads, 2 indexers). For example this returns expected results:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main
| table _time url
| mycustomcommand field_in=url&lt;/LI-CODE&gt;&lt;P&gt;but adding &lt;STRONG&gt;stats&lt;/STRONG&gt; command at the end of the search causes the search to fail with the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main
| table _time url
| mycustomcommmand field_in=url
| stats count by domain

2 errors occurred while the search was executing. Therefore, search results might be incomplete. Hide errors.
[ip-{indexer_1_ip}] Streamed search execute failed because: Error in 'mycustomcommmand' command: External search command exited unexpectedly with non-zero error code 1..
[ip-{indexer_2_ip}] Streamed search execute failed because: Error in 'mycustomcommmand' command: External search command exited unexpectedly with non-zero error code 1..&lt;/LI-CODE&gt;&lt;P&gt;Running the search directly on the indexer returns 0 results, because we don't have the url field extraction there. But there are no errors.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My questions are&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Where can I find the reason for the failure? I can't seem to find what the actual error is anywhere in the search.log.&lt;/LI&gt;&lt;LI&gt;Any ideas about what's going on here, or documentation that may help?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Wed, 04 Nov 2020 17:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-use-stats-with-custom-streaming-searchcommand/m-p/527980#M149048</guid>
      <dc:creator>wesleya</dc:creator>
      <dc:date>2020-11-04T17:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use stats with custom streaming searchcommand</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-use-stats-with-custom-streaming-searchcommand/m-p/527984#M149050</link>
      <description>&lt;P&gt;Try appending &lt;FONT face="courier new,courier"&gt;| noop&amp;nbsp;log_DEBUG=*&lt;/FONT&gt; to the search.&amp;nbsp; Then check the search log for debug messages that may help determine the cause of the error.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 18:04:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-use-stats-with-custom-streaming-searchcommand/m-p/527984#M149050</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-04T18:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use stats with custom streaming searchcommand</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-use-stats-with-custom-streaming-searchcommand/m-p/528179#M149125</link>
      <description>&lt;P&gt;Thank you for the help! This led me to figure out I was only looking at the logs for the search head.&amp;nbsp; The search was streamed to indexers when using the stats command, and those indexer search.log files can be found through the job inspector under the&amp;nbsp;&lt;SPAN&gt;Search Job Properties link.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The script errors found there (&lt;SPAN&gt;ImportError: No module named {mylib}&lt;/SPAN&gt;) led me to this answer which explains the problem nicely:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Developing-for-Splunk-Enterprise/Custom-streaming-search-command-error/m-p/523794#M4556" target="_blank"&gt;https://community.splunk.com/t5/Developing-for-Splunk-Enterprise/Custom-streaming-search-command-error/m-p/523794#M4556&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 17:10:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-use-stats-with-custom-streaming-searchcommand/m-p/528179#M149125</guid>
      <dc:creator>wesleya</dc:creator>
      <dc:date>2020-11-05T17:10:55Z</dc:date>
    </item>
  </channel>
</rss>

