<?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: Is there a way to schedule a Python Script from Splunk? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287631#M3565</link>
    <description>&lt;P&gt;You could turn your script into a scripted input, and run that on a schedule either by interval or cron.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2016 22:03:05 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-04-11T22:03:05Z</dc:date>
    <item>
      <title>Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287630#M3564</link>
      <description>&lt;P&gt;I currently have a Python script calling an API and returning the results to Splunk. I can use the &lt;CODE&gt;|script&lt;/CODE&gt; command in Splunk and the Python script works as expected. I have a dashboard built on the underlying data, which is pretty small in volume. &lt;/P&gt;

&lt;P&gt;Is there a way to schedule this script to be called within Splunk? Is the saved search the best way to go about calling the &lt;CODE&gt;|script&lt;/CODE&gt; command?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 21:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287630#M3564</guid>
      <dc:creator>markdflip</dc:creator>
      <dc:date>2016-04-11T21:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287631#M3565</link>
      <description>&lt;P&gt;You could turn your script into a scripted input, and run that on a schedule either by interval or cron.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:03:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287631#M3565</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-11T22:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287632#M3566</link>
      <description>&lt;P&gt;Do I need to create a .sh file that calls the .py file?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287632#M3566</guid>
      <dc:creator>markdflip</dc:creator>
      <dc:date>2016-04-11T22:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287633#M3567</link>
      <description>&lt;P&gt;That's the easiest approach, yes.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.0/AdvancedDev/ScriptSetup"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.0/AdvancedDev/ScriptSetup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:11:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287633#M3567</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-11T22:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287634#M3568</link>
      <description>&lt;P&gt;I tried going down the path of scripted inputs, to pretty bad results. I added the .sh script to inputs.conf, but there is no reference to the script anywhere in the logs. Is there a way to check if the script is being triggered at all?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME/etc/apps/my_app/bin/jira_wrapper_script.sh]
disabled = false # change to false to start the input, requires restart
host = local
index = jira_test
interval = 240 
source = http-simple
sourcetype = jira

[script://$SPLUNK_HOME/etc/apps/my_app/bin/jira_rest_api.py]
disabled = false # change to false to start the input, requires restart
host = local
index = jira_test
interval = 240
source = http-simple
sourcetype = jira
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am not surprised that the shell script may not work, since I have never written one before. I did expect to see error messages somewhere.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 01:35:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287634#M3568</guid>
      <dc:creator>markdflip</dc:creator>
      <dc:date>2016-04-13T01:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287635#M3569</link>
      <description>&lt;P&gt;Search for &lt;CODE&gt;index=_internal jira_wrapper_script&lt;/CODE&gt; to find infos about the script running.&lt;/P&gt;

&lt;P&gt;For a simplified example, try something like this:&lt;/P&gt;

&lt;P&gt;test.sh (set x bit with chmod!):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/sh
echo Hello
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://./bin/test.sh]
interval, index, etc.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should send an event containing just the word Hello to the index, sourcetype, etc. you specified in the inputs.conf.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 13:09:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287635#M3569</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-15T13:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287636#M3570</link>
      <description>&lt;P&gt;Hmmm, it seems my scripting skills are below par. I set up the monitoring of the python script directly through the UI and it worked flawlessly. Shell script didn't turn out as well.&lt;/P&gt;

&lt;P&gt;Turns out there was some issue with the actual sh file. The below shell script worked for anyone stumbling upon this page.&lt;/P&gt;

&lt;P&gt;shell script&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; #!/bin/bash
python "C:/Program Files/Splunk/etc/apps/my_app_name/bin/jira_rest_api.py"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Martin - thank you for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 20:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/287636#M3570</guid>
      <dc:creator>markdflip</dc:creator>
      <dc:date>2016-04-20T20:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to schedule a Python Script from Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/556156#M3571</link>
      <description>&lt;P&gt;Hey. How did you return the results of the script to Splunk?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 11:48:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-there-a-way-to-schedule-a-Python-Script-from-Splunk/m-p/556156#M3571</guid>
      <dc:creator>Temp</dc:creator>
      <dc:date>2021-06-17T11:48:30Z</dc:date>
    </item>
  </channel>
</rss>

