<?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 Why is my powershell script for input-stanza not working? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660940#M111733</link>
    <description>&lt;P&gt;Hi community! I've tried and exhausted all my brain cells but I still couldn't make this work. Any ideas?&lt;/P&gt;&lt;P&gt;Below is deployed into a Windows 11 machine, running UF 9.1.1&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/morethanyell/splunk-playground/blob/main/TA-powershell_scripting/local/inputs.conf" target="_blank" rel="noopener"&gt;splunk-playground/TA-powershell_scripting/local/inputs.conf at main · morethanyell/splunk-playground (github.com)&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2023 21:09:20 GMT</pubDate>
    <dc:creator>morethanyell</dc:creator>
    <dc:date>2023-10-16T21:09:20Z</dc:date>
    <item>
      <title>Why is my powershell script for input-stanza not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660940#M111733</link>
      <description>&lt;P&gt;Hi community! I've tried and exhausted all my brain cells but I still couldn't make this work. Any ideas?&lt;/P&gt;&lt;P&gt;Below is deployed into a Windows 11 machine, running UF 9.1.1&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/morethanyell/splunk-playground/blob/main/TA-powershell_scripting/local/inputs.conf" target="_blank" rel="noopener"&gt;splunk-playground/TA-powershell_scripting/local/inputs.conf at main · morethanyell/splunk-playground (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 21:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660940#M111733</guid>
      <dc:creator>morethanyell</dc:creator>
      <dc:date>2023-10-16T21:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my powershell script for input-stanza not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660942#M111734</link>
      <description>&lt;P&gt;You specified "schedule" setting instead of "interval".&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 21:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660942#M111734</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-10-16T21:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my powershell script for input-stanza not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660943#M111735</link>
      <description>&lt;P&gt;In&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.1/Admin/Inputsconf" target="_blank"&gt;inputs.conf - Splunk Documentation&lt;/A&gt;, it says&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[powershell://&amp;lt;name&amp;gt;]
schedule = [&amp;lt;positive integer&amp;gt;|&amp;lt;cron schedule&amp;gt;]
* How often to run the specified PowerShell command or script.
* You can specify a number in seconds, or provide a valid cron
  schedule.
* Default: Runs the command or script once, at startup.&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Oct 2023 21:33:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660943#M111735</guid>
      <dc:creator>morethanyell</dc:creator>
      <dc:date>2023-10-16T21:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my powershell script for input-stanza not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660973#M111740</link>
      <description>&lt;P&gt;Sorry, you're right. I was checking the "script" input and it has the "interval" parameter whereas powershell indeed has "schedule".&lt;/P&gt;&lt;P&gt;How do you know it's not running (and not just running and producing any results for example)?&lt;/P&gt;&lt;P&gt;What does splunk list inputstatus say?&lt;/P&gt;&lt;P&gt;My definition looks almost identical and works. From what I see you avoided the common pitfall of $SplunkHome so the path is good.&lt;/P&gt;&lt;PRE&gt;[powershell://script-checker]&lt;BR /&gt;script= . "$SplunkHome\etc\apps\cert_checker\bin\scripts\Splunk-cert-checker.ps1"&lt;BR /&gt;schedule = 86400&lt;BR /&gt;index=internal_auxiliary&lt;BR /&gt;sourcetype=kv:cert-checker&lt;BR /&gt;event_serialization_format=kv&lt;BR /&gt;disabled=0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 07:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660973#M111740</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-10-17T07:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my powershell script for input-stanza not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660997#M111748</link>
      <description>&lt;P&gt;Thanks to reddit user u/chadbaldwin who pointed out that the fault was in using `Write-Host` rather than `Write-Output`; whereas `Write-Host` isn't something Splunk is able to capture.&lt;/P&gt;&lt;P&gt;Replaced the script to use `Write-Output` and it's now working.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 11:45:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660997#M111748</guid>
      <dc:creator>morethanyell</dc:creator>
      <dc:date>2023-10-17T11:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my powershell script for input-stanza not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660998#M111749</link>
      <description>&lt;P&gt;You've never scripted on unices, have you? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But seriously - that's kinda obvious. I'd say Write-Output is like writing to stdout whereas Write-Host is more like writing to stderr (yes, I know that this analogy is not 100% correct).&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 11:49:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/660998#M111749</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-10-17T11:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my powershell script for input-stanza not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/661107#M111755</link>
      <description>&lt;P&gt;I have very little experience with scripting.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 20:14:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-powershell-script-for-input-stanza-not-working/m-p/661107#M111755</guid>
      <dc:creator>morethanyell</dc:creator>
      <dc:date>2023-10-17T20:14:10Z</dc:date>
    </item>
  </channel>
</rss>

