<?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: Getting data from prowershell script in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341651#M93822</link>
    <description>&lt;P&gt;FYI, I am on Splunk 7.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2017 12:25:44 GMT</pubDate>
    <dc:creator>aNamee</dc:creator>
    <dc:date>2017-11-06T12:25:44Z</dc:date>
    <item>
      <title>Getting data from prowershell script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341649#M93820</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am having some trouble getting data into Splunk from a powershell script.&lt;BR /&gt;
The script is a Nagios script called "Check Windows Updates using Powershell", and returning the current status of the Windows Update software using the standard output "Write-Host".&lt;BR /&gt;
My problem is that the script does not seem to run when intended.&lt;BR /&gt;
I added my check_windows_updates.ps1 script via the "Add data" wizard, but it does not seem to run.&lt;BR /&gt;
I also added an other .bat script containing the following :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@echo off
powershell check_windows_updates.ps1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it does not seem to run either, as I do not get any data from those two scipts inputs.&lt;/P&gt;

&lt;P&gt;Thanks in advance for your help! &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;: I have .Net 4.7 and Powershell 3.0 installed on my windows server&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:32:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341649#M93820</guid>
      <dc:creator>aNamee</dc:creator>
      <dc:date>2020-09-29T16:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting data from prowershell script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341650#M93821</link>
      <description>&lt;P&gt;Did any of you ever ran a powershell script as a Splunk input?&lt;BR /&gt;
Or has any other alternatives in order to get Windows Update's status?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt; : I gave a try to Splunk App for Windows, but unfortunately it does not monitor what I need. I would like to monitor the number of updates Windows has retrieved before the installation, but Splunk App for Windows only enables me to review the status of Windows' past updates&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 09:28:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341650#M93821</guid>
      <dc:creator>aNamee</dc:creator>
      <dc:date>2017-11-06T09:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Getting data from prowershell script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341651#M93822</link>
      <description>&lt;P&gt;FYI, I am on Splunk 7.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 12:25:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341651#M93822</guid>
      <dc:creator>aNamee</dc:creator>
      <dc:date>2017-11-06T12:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting data from prowershell script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341652#M93823</link>
      <description>&lt;P&gt;You are not correctly using the powershell script. You need to bundle the Powershell script as a scripted input/add-on, and then tell inputs.conf to invoke the powershell script. &lt;/P&gt;

&lt;P&gt;Here are some reference links&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/334729/how-to-troubleshoot-why-my-powershell-scripted-inp.html"&gt;https://answers.splunk.com/answers/334729/how-to-troubleshoot-why-my-powershell-scripted-inp.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/MonitorWindowsdatawithPowerShellscripts"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/MonitorWindowsdatawithPowerShellscripts&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Note, when I have done Powershell scripts as inputs, I have always used a &lt;CODE&gt;.path&lt;/CODE&gt; file approach as shown in the first link. I have never used the Splunk Powershell Add-on.  Just my experience.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 12:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341652#M93823</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-11-06T12:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Getting data from prowershell script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341653#M93824</link>
      <description>&lt;P&gt;Thanks for your answer!!&lt;BR /&gt;
I solved this problem setting up my script as a &lt;STRONG&gt;Powershell 3 modular input&lt;/STRONG&gt; instead of setting it as a standard input script, with Script path like &lt;CODE&gt;. "$SplunkHome\..."&lt;/CODE&gt; , not from C:\ and with CRON formatted Schedule.&lt;BR /&gt;
Also I changed "Write-Host" to "Write-Output" in script.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 13:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341653#M93824</guid>
      <dc:creator>aNamee</dc:creator>
      <dc:date>2017-11-06T13:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Getting data from prowershell script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341654#M93825</link>
      <description>&lt;P&gt;A .path could have been good too if I wasn't on Splunk 7 but on a version 6.2 or lower, where Powershell isn't supported natively. I find it easier to configure all via GUI than by editing config files in FS.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 13:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-data-from-prowershell-script/m-p/341654#M93825</guid>
      <dc:creator>aNamee</dc:creator>
      <dc:date>2017-11-06T13:51:59Z</dc:date>
    </item>
  </channel>
</rss>

