<?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: splunk app python script not running in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307060#M66240</link>
    <description>&lt;P&gt;Did you see my answer below?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jul 2017 00:21:24 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2017-07-14T00:21:24Z</dc:date>
    <item>
      <title>splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307054#M66234</link>
      <description>&lt;P&gt;$SPLUNK_HOME/etc/apps/cpp_name/bin/script.py&lt;BR /&gt;
i have a python script that modify the view . &lt;/P&gt;

&lt;P&gt;i assume its not running when i checked the same logic in os-python it works well. In command.conf &lt;/P&gt;

&lt;P&gt;filename = script.py&lt;BR /&gt;
retainsevents = true&lt;BR /&gt;
overrides_timeorder = false&lt;BR /&gt;
streaming = true&lt;/P&gt;

&lt;P&gt;is there anyhting else i need to do .&lt;/P&gt;

&lt;P&gt;Also i tried to check the logs in index="_internal" Error fullpath to script , it doesn't show anythin up  there.&lt;/P&gt;

&lt;P&gt;can some body help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307054#M66234</guid>
      <dc:creator>aab5272</dc:creator>
      <dc:date>2020-09-29T14:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307055#M66235</link>
      <description>&lt;P&gt;How does it modify the view?&lt;/P&gt;

&lt;P&gt;How are you executing the script within Splunk?  &lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 22:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307055#M66235</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-13T22:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307056#M66236</link>
      <description>&lt;P&gt;Try the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunk.mining.dcutils as dcu

logger = dcu.getLogger()

try:
  Your code
except Exception as e:
  logger.error(str(e))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then run the script and check index=_internal scriptName.py&lt;/P&gt;

&lt;P&gt;If that doesn't work, you've probably got a syntax or indentation error.  check the search.log in the job inspector.  Search it for scriptName.py.  &lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 23:12:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307056#M66236</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-13T23:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307057#M66237</link>
      <description>&lt;P&gt;the logs being monitored is in the form of &lt;BR /&gt;
label=labelname value=actual value&lt;BR /&gt;
now the script is intended to convert the above into&lt;BR /&gt;
labelname=actual value at search time.&lt;/P&gt;

&lt;P&gt;the python script is inside the app. My props.conf and transform.conf are working fine and the fields are getting extracted.&lt;/P&gt;

&lt;P&gt;when i run this from splunk CLI it gives me error at this line&lt;/P&gt;

&lt;P&gt;results,dummyresults,settings = splunk.Intersplunk.getOrganizedResults()&lt;BR /&gt;
and makes reference to these two function from splunk python library.&lt;BR /&gt;
/splunk/lib/python2.7/site-packages/splunk/Intersplunk.py"", line 336, in getOrganizedResults&lt;BR /&gt;
    results = readResults(input_str, settings)&lt;BR /&gt;
  File "splunk/lib/python2.7/site-packages/splunk/Intersplunk.py"", line 265, in readResults&lt;BR /&gt;
    line = input_buf.readline()&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307057#M66237</guid>
      <dc:creator>aab5272</dc:creator>
      <dc:date>2020-09-29T14:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307058#M66238</link>
      <description>&lt;P&gt;That error from Splunk cli is due to not having any results in the pipeline.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 23:37:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307058#M66238</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-13T23:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307059#M66239</link>
      <description>&lt;P&gt;but i see data being streamed .&lt;/P&gt;

&lt;P&gt;How can i fix this ?any idea?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 23:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307059#M66239</guid>
      <dc:creator>aab5272</dc:creator>
      <dc:date>2017-07-13T23:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307060#M66240</link>
      <description>&lt;P&gt;Did you see my answer below?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 00:21:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307060#M66240</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-14T00:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307061#M66241</link>
      <description>&lt;P&gt;I used your comment but i get th ebelow error  i am not sure why &lt;/P&gt;

&lt;P&gt;utils/bin/script.py&lt;/P&gt;

&lt;P&gt;from splunk.Intersplunk import dcu&lt;BR /&gt;
07-14-2017 16:14:10.376 ERROR ScriptRunner - stderr from '/productos/pentaho/splunk/bin/python /productos/pentaho/splunk/etc/apps/utils/bin/script.py':          from ^ splunk.Intersplunk import dcu&lt;BR /&gt;
07-14-2017 16:14:10.376 ERROR ScriptRunner - stderr from '/productos/pentaho/splunk/bin/python /productos/pentaho/splunk/etc/apps/utils/bin/script.py':  SyntaxError: invalid syntax&lt;BR /&gt;
07-14-2017 16:14:10.376 ERROR ScriptRunner - extern write error: errno=Broken pipe&lt;/P&gt;

&lt;P&gt;from splunk.Intersplunk import dcu&lt;/P&gt;

&lt;P&gt;I am not sure whats the syntax error in this . Well your answer helped me in debugging i am getting closed to what i want.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 20:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307061#M66241</guid>
      <dc:creator>aab5272</dc:creator>
      <dc:date>2017-07-14T20:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307062#M66242</link>
      <description>&lt;P&gt;Try enabling show all characters in notepad++ and checking for tabs etc.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 21:57:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307062#M66242</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-14T21:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307063#M66243</link>
      <description>&lt;P&gt;Also can you show me the exact command/search you are using to execute the code?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 21:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307063#M66243</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-14T21:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307064#M66244</link>
      <description>&lt;P&gt;index="indexname" | script from the UI&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 22:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307064#M66244</guid>
      <dc:creator>aab5272</dc:creator>
      <dc:date>2017-07-14T22:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: splunk app python script not running</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307065#M66245</link>
      <description>&lt;P&gt;Can you post the code?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2017 00:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-app-python-script-not-running/m-p/307065#M66245</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-15T00:39:47Z</dc:date>
    </item>
  </channel>
</rss>

