<?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 extract events from simple Scripted Input stdout? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143971#M29407</link>
    <description>&lt;P&gt;In splunkd.log I can see:&lt;BR /&gt;
06-06-2015 15:41:37.321 -0400 INFO  ExecProcessor - New scheduled exec process: python /opt/splunk/bin/scripts/test.py&lt;/P&gt;

&lt;P&gt;The script is working, I have checked it (it created log file etc) however no events&lt;/P&gt;</description>
    <pubDate>Sat, 06 Jun 2015 19:49:55 GMT</pubDate>
    <dc:creator>tiandrey</dc:creator>
    <dc:date>2015-06-06T19:49:55Z</dc:date>
    <item>
      <title>How to extract events from simple Scripted Input stdout?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143969#M29405</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I'm trying to understand Scripted Inputs concept so I have created simple Scripted Input with Python script:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys
sys.stdout.write('test1,test2,test3\n')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to add these events in the main index.&lt;BR /&gt;
My Scripted Input lies in search app, I have added pops.conf (all configs are in the local folder of the search app):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[test]
TIME_PREFIX=^[^\|]+\|
TIME_FORMAT=%Q
SHOULD_LINEMERGE=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME\bin\scripts\test.py]
disabled = 0
index = main
interval = 15
sourcetype = test
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Howerer I don't see any events in my main index, also nothing in logs either. I have splunk enterprise under a local account on Windows.&lt;BR /&gt;
Where is my mistake?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2015 16:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143969#M29405</guid>
      <dc:creator>tiandrey</dc:creator>
      <dc:date>2015-06-06T16:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract events from simple Scripted Input stdout?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143970#M29406</link>
      <description>&lt;P&gt;Are there any errors in splunkd.log?&lt;BR /&gt;
You probably need a wrapper script (.cmd) to execute the python code, because the ".py" extension may not be registered to execute python directly.&lt;/P&gt;

&lt;P&gt;The recommended way to execute a python script from Splunk is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME/bin/splunk cmd python &amp;lt;your_script&amp;gt;.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting"&gt;http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2015 17:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143970#M29406</guid>
      <dc:creator>kurdbahr</dc:creator>
      <dc:date>2015-06-06T17:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract events from simple Scripted Input stdout?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143971#M29407</link>
      <description>&lt;P&gt;In splunkd.log I can see:&lt;BR /&gt;
06-06-2015 15:41:37.321 -0400 INFO  ExecProcessor - New scheduled exec process: python /opt/splunk/bin/scripts/test.py&lt;/P&gt;

&lt;P&gt;The script is working, I have checked it (it created log file etc) however no events&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2015 19:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143971#M29407</guid>
      <dc:creator>tiandrey</dc:creator>
      <dc:date>2015-06-06T19:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract events from simple Scripted Input stdout?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143972#M29408</link>
      <description>&lt;P&gt;It seems I have solved the problem. My output was in wrong format. This format works:&lt;BR /&gt;
print "%s eventID=%s" % ("[" + strftime("%m/%d/%Y %H:%M:%S %p %Z",localtime()) + "]", int(time.time()))&lt;BR /&gt;
But I have another question, how to make splunk read my custom formated event?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2015 20:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-events-from-simple-Scripted-Input-stdout/m-p/143972#M29408</guid>
      <dc:creator>tiandrey</dc:creator>
      <dc:date>2015-06-06T20:03:45Z</dc:date>
    </item>
  </channel>
</rss>

