<?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: Splunk PowerShell Modula Input always returns fallback result in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-PowerShell-Modula-Input-always-returns-fallback-result/m-p/390898#M69917</link>
    <description>&lt;P&gt;Where you are running this script?&lt;/P&gt;

&lt;P&gt;Paste the whole script .&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jun 2018 11:04:18 GMT</pubDate>
    <dc:creator>ansif</dc:creator>
    <dc:date>2018-06-11T11:04:18Z</dc:date>
    <item>
      <title>Splunk PowerShell Modula Input always returns fallback result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-PowerShell-Modula-Input-always-returns-fallback-result/m-p/390897#M69916</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;

&lt;P&gt;I have setup a PowerShell modular input; executing a script every 5 minutes.&lt;/P&gt;

&lt;P&gt;Running the script on the splunk (enterprise) server in PS ISE - I get the following output:&lt;BR /&gt;
host                : &lt;BR /&gt;
Server_IP           : &lt;BR /&gt;
Page_Return_Code    : 200&lt;BR /&gt;
Page_Return_Message : OK&lt;BR /&gt;
Page_Execution_Time : 1800&lt;BR /&gt;
Page_Login_Result   : Good&lt;BR /&gt;
source              : PowerShell/Connectivity&lt;/P&gt;

&lt;P&gt;I can assume, the script itself is working fine.&lt;/P&gt;

&lt;P&gt;Calling the same from splunk, I get:&lt;BR /&gt;
host=""&lt;BR /&gt;
Server_IP=""&lt;BR /&gt;
Page_Return_Code="-1"&lt;BR /&gt;
Page_Return_Message="DOWN"&lt;BR /&gt;
Page_Execution_Time="2222"&lt;BR /&gt;
Page_Login_Result="Bad"&lt;BR /&gt;
source="PowerShell/Connectivity"&lt;/P&gt;

&lt;P&gt;Question 1)&lt;BR /&gt;
Executing the script via splunk modular input, why do I get the opposite result? Do I need to tell the input someplace, to execute the script always on the splunk server?&lt;/P&gt;

&lt;P&gt;Question 2)&lt;BR /&gt;
How to I get splunk to automatically separate the 'Event' into fields?&lt;/P&gt;

&lt;P&gt;Snippets from the PS script (server and IP values have been omitted):&lt;/P&gt;

&lt;H1&gt;Definition of the Splunk return object&lt;/H1&gt;

&lt;P&gt;$SplunkObject = [PSCustomObject]@{&lt;BR /&gt;
host = '&lt;BR /&gt;
Server_IP = ''&lt;BR /&gt;
Page_Return_Code = ''&lt;BR /&gt;
Page_Return_Message = ''&lt;BR /&gt;
Page_Execution_Time = ''&lt;BR /&gt;
Page_Login_Result = ''&lt;BR /&gt;
source = "PowerShell/Connectivity"&lt;BR /&gt;
}&lt;BR /&gt;
.....&lt;/P&gt;

&lt;H1&gt;Return values to Splunk Event Adapter&lt;/H1&gt;

&lt;P&gt;Write-output $SplunkObject&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-PowerShell-Modula-Input-always-returns-fallback-result/m-p/390897#M69916</guid>
      <dc:creator>tnicklau</dc:creator>
      <dc:date>2020-09-29T19:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk PowerShell Modula Input always returns fallback result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-PowerShell-Modula-Input-always-returns-fallback-result/m-p/390898#M69917</link>
      <description>&lt;P&gt;Where you are running this script?&lt;/P&gt;

&lt;P&gt;Paste the whole script .&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 11:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-PowerShell-Modula-Input-always-returns-fallback-result/m-p/390898#M69917</guid>
      <dc:creator>ansif</dc:creator>
      <dc:date>2018-06-11T11:04:18Z</dc:date>
    </item>
  </channel>
</rss>

