<?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: SA-Modularinput-powershell (V3): scheduler fails scheduling with more than one stanza in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/SA-Modularinput-powershell-V3-scheduler-fails-scheduling-with/m-p/420752#M94077</link>
    <description>&lt;P&gt;@forca,  If your problem is resolved, please add some details to your answer to help others that might have the same problem.  Then accept the answer.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 11:10:10 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-10-15T11:10:10Z</dc:date>
    <item>
      <title>SA-Modularinput-powershell (V3): scheduler fails scheduling with more than one stanza</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SA-Modularinput-powershell-V3-scheduler-fails-scheduling-with/m-p/420750#M94075</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;
We are running Splunk Enterprise version 7.2.0.&lt;BR /&gt;
On this version and also on 6.6, we find that when we have more than one scheduled powershell input, the second fails with the following message in splunk-powershell.ps1.log:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR User script exception: : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If any of the inputs are the only scheduled they run as expected.&lt;BR /&gt;
The inputs are:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[powershell://FetchMachineCache_Contents_DMZ_Prod]
host = XXXX
index = looper
interval = 900
script = . "$SPLUNKHOME\bin\scripts\FetchMachineCache_Contents_DMZ_Prod.ps1"
disabled = 0

[powershell://FetchMachineCache_Contents_Prod]
host = XXXX
index = looper
interval = 180 
script = . "$SPLUNKHOME\bin\scripts\FetchMachineCache_Contents_Prod.ps1"
disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Oct 2018 09:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SA-Modularinput-powershell-V3-scheduler-fails-scheduling-with/m-p/420750#M94075</guid>
      <dc:creator>forca</dc:creator>
      <dc:date>2018-10-09T09:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: SA-Modularinput-powershell (V3): scheduler fails scheduling with more than one stanza</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SA-Modularinput-powershell-V3-scheduler-fails-scheduling-with/m-p/420751#M94076</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;

&lt;P&gt;It turned out that the issue was that the powershell scripts used &lt;CODE&gt;Invoke-Sqlcmd&lt;/CODE&gt;which is not thread-safe.&lt;BR /&gt;
That caused the scripts to fail with the mentioned error.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 08:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SA-Modularinput-powershell-V3-scheduler-fails-scheduling-with/m-p/420751#M94076</guid>
      <dc:creator>forca</dc:creator>
      <dc:date>2018-10-15T08:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: SA-Modularinput-powershell (V3): scheduler fails scheduling with more than one stanza</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SA-Modularinput-powershell-V3-scheduler-fails-scheduling-with/m-p/420752#M94077</link>
      <description>&lt;P&gt;@forca,  If your problem is resolved, please add some details to your answer to help others that might have the same problem.  Then accept the answer.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 11:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SA-Modularinput-powershell-V3-scheduler-fails-scheduling-with/m-p/420752#M94077</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-10-15T11:10:10Z</dc:date>
    </item>
  </channel>
</rss>

