<?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 Inconsistent PowerShell Script behaviour in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Inconsistent-PowerShell-Script-behaviour/m-p/490632#M83866</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to get input from a powershell script.&lt;BR /&gt;
It drives me up the walls. I already have other PS scripts running just fine, so this really puzzles me.&lt;BR /&gt;
I have 3 heavy forwarder on Splunk 8.0.2.1 and 18 universal forwarders on Splunk 7.2.4.&lt;BR /&gt;
When using this inputs.conf setting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[powershell://df]
script = Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID,Size,FreeSpace | findstr.exe  '[0-9]$'
index = os_monitoring
schedule=*/5 * * * *
source=df-win
sourcetype=os:monitoring:diskspace
disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get only input on 3 UF hosts and 2 HF hosts.&lt;BR /&gt;
One of the HF hosts delivers the following in the _audit log, but no output.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05-04-2020 16:35:00.0014151+2 INFO enqueue job for stanza=df
05-04-2020 16:35:00.0014151+2 INFO Start executing script=Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID,Size,FreeSpace | findstr.exe  '[0-9]$' for stanza=df
05-04-2020 16:35:00.0170289+2 INFO End of executing script=Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID,Size,FreeSpace | findstr.exe  '[0-9]$' for stanza=df, execution_time=0.0156138 seconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The other boxes do not deliver anything in terms of output or errors, I just see that the app is deployed.&lt;/P&gt;

&lt;P&gt;When switching to a real script like in the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;script = . "$SplunkHome\etc\apps\FA-windows-diskspace\bin\scripts\df.ps1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I again get the the same result. The majority of systems do not deliver output and I see no errors in the _* indices.&lt;/P&gt;

&lt;P&gt;I am a bit lost.&lt;BR /&gt;
I would expect all machines to fail or none, but not this inconsistent behaviour.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;thx&lt;BR /&gt;
afx&lt;/P&gt;</description>
    <pubDate>Mon, 04 May 2020 15:10:06 GMT</pubDate>
    <dc:creator>afx</dc:creator>
    <dc:date>2020-05-04T15:10:06Z</dc:date>
    <item>
      <title>Inconsistent PowerShell Script behaviour</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inconsistent-PowerShell-Script-behaviour/m-p/490632#M83866</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to get input from a powershell script.&lt;BR /&gt;
It drives me up the walls. I already have other PS scripts running just fine, so this really puzzles me.&lt;BR /&gt;
I have 3 heavy forwarder on Splunk 8.0.2.1 and 18 universal forwarders on Splunk 7.2.4.&lt;BR /&gt;
When using this inputs.conf setting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[powershell://df]
script = Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID,Size,FreeSpace | findstr.exe  '[0-9]$'
index = os_monitoring
schedule=*/5 * * * *
source=df-win
sourcetype=os:monitoring:diskspace
disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get only input on 3 UF hosts and 2 HF hosts.&lt;BR /&gt;
One of the HF hosts delivers the following in the _audit log, but no output.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05-04-2020 16:35:00.0014151+2 INFO enqueue job for stanza=df
05-04-2020 16:35:00.0014151+2 INFO Start executing script=Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID,Size,FreeSpace | findstr.exe  '[0-9]$' for stanza=df
05-04-2020 16:35:00.0170289+2 INFO End of executing script=Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID,Size,FreeSpace | findstr.exe  '[0-9]$' for stanza=df, execution_time=0.0156138 seconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The other boxes do not deliver anything in terms of output or errors, I just see that the app is deployed.&lt;/P&gt;

&lt;P&gt;When switching to a real script like in the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;script = . "$SplunkHome\etc\apps\FA-windows-diskspace\bin\scripts\df.ps1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I again get the the same result. The majority of systems do not deliver output and I see no errors in the _* indices.&lt;/P&gt;

&lt;P&gt;I am a bit lost.&lt;BR /&gt;
I would expect all machines to fail or none, but not this inconsistent behaviour.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;thx&lt;BR /&gt;
afx&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 15:10:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inconsistent-PowerShell-Script-behaviour/m-p/490632#M83866</guid>
      <dc:creator>afx</dc:creator>
      <dc:date>2020-05-04T15:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent PowerShell Script behaviour</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inconsistent-PowerShell-Script-behaviour/m-p/490633#M83867</link>
      <description>&lt;P&gt;Ok,&lt;BR /&gt;
to answer my own question...&lt;BR /&gt;
On Some systems doing a findstr "[0-9]$" worked, on some not. Some Windows/PS silliness I guess.&lt;BR /&gt;
But that also begs the question, why does splunk not tell me that the script has been executed in general?&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 11:24:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inconsistent-PowerShell-Script-behaviour/m-p/490633#M83867</guid>
      <dc:creator>afx</dc:creator>
      <dc:date>2020-05-08T11:24:57Z</dc:date>
    </item>
  </channel>
</rss>

