<?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: Is there a way to run a PowerShell script locally from Splunk? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403147#M71637</link>
    <description>&lt;P&gt;Wouldn't this ingest it though? I'm trying to not ingest logs at a regular cadence, just call an API and read logs in on a one-off basis without having them live on an indexer&lt;/P&gt;</description>
    <pubDate>Fri, 28 Sep 2018 18:38:21 GMT</pubDate>
    <dc:creator>SplunkIsLife</dc:creator>
    <dc:date>2018-09-28T18:38:21Z</dc:date>
    <item>
      <title>Is there a way to run a PowerShell script locally from Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403145#M71635</link>
      <description>&lt;P&gt;I'm trying to hit an API with a PowerShell command through Splunk without needing to ingest the logs on a regular cadence (and setting up a VM to forward the logs, etc). Is there a way to do this with a command similar to the &lt;CODE&gt;|jira&lt;/CODE&gt; command?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 17:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403145#M71635</guid>
      <dc:creator>SplunkIsLife</dc:creator>
      <dc:date>2018-09-28T17:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to run a PowerShell script locally from Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403146#M71636</link>
      <description>&lt;P&gt;I don't see why not.&lt;/P&gt;

&lt;P&gt;We have some powershell scripts that we just kick off by way of a batch file. So get a working batch file that runs your powershell the way you would expect, then put the batch file in Splunk at whatever internval/sourcetype whatever you like in Settings&amp;gt;&amp;gt;Data inputs&amp;gt;&amp;gt;Scripts. &lt;/P&gt;

&lt;P&gt;Or maybe under &lt;BR /&gt;
Powershell v3 Modular Input&lt;BR /&gt;
Settings&amp;gt;&amp;gt;Data inputs » Powershell v3 Modular Input.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 17:54:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403146#M71636</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2018-09-28T17:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to run a PowerShell script locally from Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403147#M71637</link>
      <description>&lt;P&gt;Wouldn't this ingest it though? I'm trying to not ingest logs at a regular cadence, just call an API and read logs in on a one-off basis without having them live on an indexer&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 18:38:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403147#M71637</guid>
      <dc:creator>SplunkIsLife</dc:creator>
      <dc:date>2018-09-28T18:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to run a PowerShell script locally from Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403148#M71638</link>
      <description>&lt;P&gt;Maybe, maybe not. If your powershell/batch executes and writes out to a text/log file but does not echo it to console then Splunk will ingest the command, and the output of the command. &lt;CODE&gt;@echo&lt;/CODE&gt; off?&lt;/P&gt;

&lt;P&gt;Something like..&lt;/P&gt;

&lt;P&gt;DATE  C:\Somefolder\somefile.bat&lt;BR /&gt;
DATE  C:\Somefolder\somefile.ps1&lt;/P&gt;

&lt;P&gt;and that should be it.&lt;/P&gt;

&lt;P&gt;You can then tell the file monitor portion of Splunk to read the output file log if you so choose. &lt;BR /&gt;
If the scripts output verbosely to the console then Splunk will probably pick that up.&lt;/P&gt;

&lt;P&gt;I've not done Windows batch in a while or powershell scripting much at all, but I think you would want your file to do the Linux equivalent of &lt;CODE&gt;&amp;gt;dev null&lt;/CODE&gt; if you don't want Splunk to pickup the actual script output. &lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 17:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-run-a-PowerShell-script-locally-from-Splunk/m-p/403148#M71638</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2018-10-02T17:21:35Z</dc:date>
    </item>
  </channel>
</rss>

