<?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 After restarting the Splunk forwarder, why is my Powershell script in inputs.conf only running once, not continuously? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/After-restarting-the-Splunk-forwarder-why-is-my-Powershell/m-p/215113#M42345</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I am trying to Invoke output of a Powershell script in to Elasticsearch. In this Splunk forwarder, job is to just trigger the script and Invoke-WebRequest that will push the output into Elasticsearch. &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;When I restart the Splunk forwarder manually, the data is pushing in to Elasticsearch &lt;/LI&gt;
&lt;LI&gt;After manual restart, Splunk is able to trigger the script only once automatically and it's not triggering the script continuously&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[powershell://Metric]
script = . "$SplunkHome\bin\scripts\metric.ps1"
schedule = */5 * * * *
sourcetype = Winmetric
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also I have tried with  &lt;CODE&gt;schedule = 5 * * ? * *&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;interval = 300&lt;/CODE&gt; and no logs were generated in the splunkd file which is related to the script.&lt;/P&gt;

&lt;P&gt;Forwarder version - 6.4.2&lt;BR /&gt;
Thanks for any help&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2016 15:24:22 GMT</pubDate>
    <dc:creator>rajkumar3v</dc:creator>
    <dc:date>2016-08-08T15:24:22Z</dc:date>
    <item>
      <title>After restarting the Splunk forwarder, why is my Powershell script in inputs.conf only running once, not continuously?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/After-restarting-the-Splunk-forwarder-why-is-my-Powershell/m-p/215113#M42345</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I am trying to Invoke output of a Powershell script in to Elasticsearch. In this Splunk forwarder, job is to just trigger the script and Invoke-WebRequest that will push the output into Elasticsearch. &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;When I restart the Splunk forwarder manually, the data is pushing in to Elasticsearch &lt;/LI&gt;
&lt;LI&gt;After manual restart, Splunk is able to trigger the script only once automatically and it's not triggering the script continuously&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[powershell://Metric]
script = . "$SplunkHome\bin\scripts\metric.ps1"
schedule = */5 * * * *
sourcetype = Winmetric
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also I have tried with  &lt;CODE&gt;schedule = 5 * * ? * *&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;interval = 300&lt;/CODE&gt; and no logs were generated in the splunkd file which is related to the script.&lt;/P&gt;

&lt;P&gt;Forwarder version - 6.4.2&lt;BR /&gt;
Thanks for any help&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 15:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/After-restarting-the-Splunk-forwarder-why-is-my-Powershell/m-p/215113#M42345</guid>
      <dc:creator>rajkumar3v</dc:creator>
      <dc:date>2016-08-08T15:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: After restarting the Splunk forwarder, why is my Powershell script in inputs.conf only running once, not continuously?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/After-restarting-the-Splunk-forwarder-why-is-my-Powershell/m-p/215114#M42346</link>
      <description>&lt;P&gt;I think your setting is incorrect for the schedule.  From the inputs.conf.spec:&lt;/P&gt;

&lt;P&gt;interval = [|]&lt;BR /&gt;
 * How often to execute the specified command (in seconds), or a valid cron&lt;BR /&gt;
  schedule.&lt;BR /&gt;
 * NOTE: when a cron schedule is specified, the script is not executed on&lt;BR /&gt;
  start-up.&lt;BR /&gt;
 * If specified as a number, may have a fractional component; e.g., 3.14&lt;BR /&gt;
 * Splunk's cron implementation does not currently support names of months/days.&lt;BR /&gt;
 * Defaults to 60.0 seconds.&lt;BR /&gt;
 * The special value 0 will force this scripted input to be executed non-stop;&lt;BR /&gt;
  that is, as soon as script exits, we shall re-start it.&lt;BR /&gt;
 * The special value -1 causes the scripted input to run once on start-up.&lt;/P&gt;

&lt;P&gt;If you want it to run non-stop it should be:&lt;/P&gt;

&lt;P&gt;interval=0&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 17:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/After-restarting-the-Splunk-forwarder-why-is-my-Powershell/m-p/215114#M42346</guid>
      <dc:creator>sjohnson_splunk</dc:creator>
      <dc:date>2016-08-08T17:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: After restarting the Splunk forwarder, why is my Powershell script in inputs.conf only running once, not continuously?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/After-restarting-the-Splunk-forwarder-why-is-my-Powershell/m-p/215115#M42347</link>
      <description>&lt;P&gt;Sorry - I forgot you have it under a powershell stanza.&lt;/P&gt;

&lt;P&gt;If you can't make that work, maybe you can run it under a script stanza where you could use the interval=0 setting&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;powershell -executionPolicy RemoteSigned -command .$SplunkHome\bin\scripts\metric.ps1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Aug 2016 17:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/After-restarting-the-Splunk-forwarder-why-is-my-Powershell/m-p/215115#M42347</guid>
      <dc:creator>sjohnson_splunk</dc:creator>
      <dc:date>2016-08-08T17:53:56Z</dc:date>
    </item>
  </channel>
</rss>

