<?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: When executing two different PowerShell scripts in inputs.conf, why does only one script work? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277382#M53183</link>
    <description>&lt;P&gt;it parse each row as single event. &lt;BR /&gt;
do you know what can I do about it?&lt;/P&gt;</description>
    <pubDate>Mon, 26 Dec 2016 09:26:20 GMT</pubDate>
    <dc:creator>Danii</dc:creator>
    <dc:date>2016-12-26T09:26:20Z</dc:date>
    <item>
      <title>When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277371#M53172</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I'm trying to execute 2 different powershell scripts with different sourcetypes but on the same index. one of them is running but the second does not.&lt;/P&gt;

&lt;P&gt;moreover, when i put one of the scripts in disabled=false and the other as true, it runs ok.&lt;/P&gt;

&lt;P&gt;did it happen to someone?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 14:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277371#M53172</guid>
      <dc:creator>Danii</dc:creator>
      <dc:date>2016-12-12T14:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277372#M53173</link>
      <description>&lt;P&gt;Can you share your input.conf configuration (for these two scripted input)?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 17:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277372#M53173</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-12T17:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277373#M53174</link>
      <description>&lt;P&gt;yeah sure, that's my input.conf:&lt;/P&gt;

&lt;H6&gt;First Script&lt;/H6&gt;

&lt;P&gt;[powershell://first_script]&lt;BR /&gt;
script= . "$SplunkHome/etc/.... firstScript.ps1"&lt;BR /&gt;
index= first_script&lt;/P&gt;

&lt;H1&gt;schedule = 00 4 * * *&lt;/H1&gt;

&lt;P&gt;sourcetype= first_script&lt;BR /&gt;
disabled = false&lt;/P&gt;

&lt;H6&gt;Second Script&lt;/H6&gt;

&lt;P&gt;[powershell://second_script]&lt;BR /&gt;
script= . "$SplunkHome/etc/.... secondScript.ps1"&lt;BR /&gt;
index= second_script&lt;/P&gt;

&lt;H1&gt;schedule = 00 5 * * *&lt;/H1&gt;

&lt;P&gt;sourcetype= second_script&lt;BR /&gt;
disabled = false&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:04:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277373#M53174</guid>
      <dc:creator>Danii</dc:creator>
      <dc:date>2020-09-29T12:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277374#M53175</link>
      <description>&lt;P&gt;This happened to me a few months ago. I fixed it by creating a batch script to call the powershell script. &lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 12:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277374#M53175</guid>
      <dc:creator>adayton20</dc:creator>
      <dc:date>2016-12-14T12:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277375#M53176</link>
      <description>&lt;P&gt;but then can i make it with two different sourcetypes?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 13:32:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277375#M53176</guid>
      <dc:creator>Danii</dc:creator>
      <dc:date>2016-12-14T13:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277376#M53177</link>
      <description>&lt;P&gt;Yeah, using the same method you have above. Just replace the .ps1 with the .bat which calls the .ps1. You can keep the same sourcetypes or change them at your leisure. &lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 13:40:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277376#M53177</guid>
      <dc:creator>adayton20</dc:creator>
      <dc:date>2016-12-14T13:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277377#M53178</link>
      <description>&lt;P&gt;it brings me to splunk the bat text &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;can you put you example please?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 14:36:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277377#M53178</guid>
      <dc:creator>Danii</dc:creator>
      <dc:date>2016-12-14T14:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277378#M53179</link>
      <description>&lt;P&gt;Sure, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@echo off powershell.exe -ExecutionPolicy bypass -file "X:\Path\to\your\script.ps1"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Dec 2016 14:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277378#M53179</guid>
      <dc:creator>adayton20</dc:creator>
      <dc:date>2016-12-14T14:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277379#M53180</link>
      <description>&lt;P&gt;sorry for the delay,&lt;BR /&gt;
I've just tried it but and it does the job this time but again only for one of the scripts &lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 13:40:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277379#M53180</guid>
      <dc:creator>Danii</dc:creator>
      <dc:date>2016-12-21T13:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277380#M53181</link>
      <description>&lt;P&gt;A few things:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;I think your script attribute value in the stanza might be incorrect. The forward slashes should be backslashes in a windows environment: &lt;A href="http://docs.splunk.com/Documentation/AddOns/released/MSPowerShell/Configuration"&gt;http://docs.splunk.com/Documentation/AddOns/released/MSPowerShell/Configuration&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Try the full path name, no dots. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;It also appears you are missing an opening bracket [ in front of the PowerShell in the stanza header.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;If it still isn't working after that:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Have you checked splunkd.log for that stanza/script for any errors? If no, try that. You can do this via the search head by looking in &lt;CODE&gt;index=_internal sourcetype=splunkd&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Do these two different scripts provide two unique outputs? Ie, do not have the same hash value?&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277380#M53181</guid>
      <dc:creator>adayton20</dc:creator>
      <dc:date>2016-12-21T15:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277381#M53182</link>
      <description>&lt;P&gt;thanks for the answer,&lt;BR /&gt;
for the 3 first points it's OK it is like this, i was wrong while copying it.&lt;/P&gt;

&lt;P&gt;Now the problem is that it takes both of them with bat files but it take each row as a single event.&lt;BR /&gt;
did it happen to you somehow?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 07:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277381#M53182</guid>
      <dc:creator>Danii</dc:creator>
      <dc:date>2016-12-26T07:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: When executing two different PowerShell scripts in inputs.conf, why does only one script work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277382#M53183</link>
      <description>&lt;P&gt;it parse each row as single event. &lt;BR /&gt;
do you know what can I do about it?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 09:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-executing-two-different-PowerShell-scripts-in-inputs-conf/m-p/277382#M53183</guid>
      <dc:creator>Danii</dc:creator>
      <dc:date>2016-12-26T09:26:20Z</dc:date>
    </item>
  </channel>
</rss>

