<?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 Powershell and crontab with universal forwarder not working as expected in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-and-crontab-with-universal-forwarder-not-working-as/m-p/506269#M86207</link>
    <description>&lt;P&gt;I have done some really basic testing as i want to prove that this is not working correctly. I have added 3 scripts into a clean input.conf&lt;/P&gt;&lt;P&gt;[powershell://Powershell01]&lt;BR /&gt;script = 'Filetest01' | out-file "c:\temp\filetest01 $(get-date -f "yyyy-MM-dd HH.mm").txt"&lt;BR /&gt;schedule = */5 * * * *&lt;BR /&gt;Index = Sandbox&lt;BR /&gt;Source = Powershell-test01&lt;BR /&gt;Sourcetype = Powershellscript&lt;/P&gt;&lt;P&gt;[powershell://Powershell02]&lt;BR /&gt;script = 'Filetest02' | out-file "c:\temp\filetest02 $(get-date -f "yyyy-MM-dd HH.mm").txt"&lt;BR /&gt;schedule = */5 * * * *&lt;BR /&gt;Index = Sandbox&lt;BR /&gt;Source = Powershell-test02&lt;BR /&gt;Sourcetype = Powershellscript&lt;/P&gt;&lt;P&gt;[powershell://Powershell03]&lt;BR /&gt;script = 'Filetest03' | out-file "c:\temp\filetest03 $(get-date -f "yyyy-MM-dd HH.mm").txt"&lt;BR /&gt;schedule = */5 * * * *&lt;BR /&gt;Index = Sandbox&lt;BR /&gt;Source = Powershell-test03&lt;BR /&gt;Sourcetype = Powershellscript&lt;/P&gt;&lt;P&gt;The log is reporting this when starting the service&lt;/P&gt;&lt;P&gt;06-26-2020 10:06:07.1442893+2 INFO Exiting powershell host script.&lt;BR /&gt;06-26-2020 10:06:22.8073774+2 INFO start splunk-powerhsell.ps1&lt;BR /&gt;06-26-2020 10:06:24.2149136+2 INFO launched disposer&lt;/P&gt;&lt;P&gt;this is the result&lt;/P&gt;&lt;P&gt;1. Filetest01 starts to run as the first job when the service is restart, but non of the other&lt;BR /&gt;2. File should not start 1 sec behind schedule&lt;BR /&gt;3. Some scripts will execute 2 times&lt;BR /&gt;4. Filetest2 was skipped once. it goes from 10 &amp;gt; 20 where it was expected to be each 5 min&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Name LastWriteTime&lt;BR /&gt;---- -------------&lt;BR /&gt;filetest01 2020-06-26 10.06.txt 26-06-2020 10:06:24&lt;BR /&gt;filetest01 2020-06-26 10.14.txt 26-06-2020 10:14:59&lt;BR /&gt;filetest01 2020-06-26 10.19.txt 26-06-2020 10:19:59&lt;BR /&gt;filetest01 2020-06-26 10.20.txt 26-06-2020 10:20:00&lt;BR /&gt;filetest01 2020-06-26 10.29.txt 26-06-2020 10:29:59&lt;BR /&gt;filetest01 2020-06-26 10.34.txt 26-06-2020 10:34:59&lt;BR /&gt;filetest01 2020-06-26 10.35.txt 26-06-2020 10:35:00&lt;BR /&gt;filetest01 2020-06-26 10.44.txt 26-06-2020 10:44:59&lt;BR /&gt;filetest01 2020-06-26 10.49.txt 26-06-2020 10:49:59&lt;BR /&gt;filetest01 2020-06-26 10.50.txt 26-06-2020 10:50:00&lt;BR /&gt;filetest02 2020-06-26 10.09.txt 26-06-2020 10:09:59&lt;BR /&gt;filetest02 2020-06-26 10.10.txt 26-06-2020 10:10:00&lt;BR /&gt;filetest02 2020-06-26 10.19.txt 26-06-2020 10:19:59&lt;BR /&gt;filetest02 2020-06-26 10.24.txt 26-06-2020 10:24:59&lt;BR /&gt;filetest02 2020-06-26 10.25.txt 26-06-2020 10:25:00&lt;BR /&gt;filetest02 2020-06-26 10.34.txt 26-06-2020 10:34:59&lt;BR /&gt;filetest02 2020-06-26 10.39.txt 26-06-2020 10:39:59&lt;BR /&gt;filetest02 2020-06-26 10.40.txt 26-06-2020 10:40:00&lt;BR /&gt;filetest02 2020-06-26 10.49.txt 26-06-2020 10:49:59&lt;BR /&gt;filetest03 2020-06-26 10.09.txt 26-06-2020 10:09:59&lt;BR /&gt;filetest03 2020-06-26 10.14.txt 26-06-2020 10:14:59&lt;BR /&gt;filetest03 2020-06-26 10.15.txt 26-06-2020 10:15:00&lt;BR /&gt;filetest03 2020-06-26 10.24.txt 26-06-2020 10:24:59&lt;BR /&gt;filetest03 2020-06-26 10.29.txt 26-06-2020 10:29:59&lt;BR /&gt;filetest03 2020-06-26 10.30.txt 26-06-2020 10:30:00&lt;BR /&gt;filetest03 2020-06-26 10.39.txt 26-06-2020 10:39:59&lt;BR /&gt;filetest03 2020-06-26 10.44.txt 26-06-2020 10:44:59&lt;BR /&gt;filetest03 2020-06-26 10.45.txt 26-06-2020 10:45:00&lt;/P&gt;&lt;P&gt;UniversalForwarder Version&amp;nbsp;7.0.2.0&lt;/P&gt;&lt;P&gt;Upgraded to Version&amp;nbsp;8.0.4.0&lt;/P&gt;&lt;P&gt;After upgrade it looks good&lt;/P&gt;&lt;P&gt;Name LastWriteTime&lt;BR /&gt;---- -------------&lt;BR /&gt;filetest01 2020-06-26 10.57.txt 26-06-2020 10:57:12&lt;BR /&gt;filetest01 2020-06-26 11.00.txt 26-06-2020 11:00:00&lt;BR /&gt;filetest01 2020-06-26 11.05.txt 26-06-2020 11:05:00&lt;BR /&gt;filetest02 2020-06-26 10.57.txt 26-06-2020 10:57:12&lt;BR /&gt;filetest02 2020-06-26 11.00.txt 26-06-2020 11:00:00&lt;BR /&gt;filetest02 2020-06-26 11.05.txt 26-06-2020 11:05:00&lt;BR /&gt;filetest03 2020-06-26 10.57.txt 26-06-2020 10:57:12&lt;BR /&gt;filetest03 2020-06-26 11.00.txt 26-06-2020 11:00:00&lt;BR /&gt;filetest03 2020-06-26 11.05.txt 26-06-2020 11:05:00&lt;/P&gt;&lt;P&gt;At last i found out this was a problem in the splunk version that was fixed later.&lt;/P&gt;&lt;P&gt;Is it possible to not have Splunk run all scripts when starting the service. as i don't think it support Cron 0/5 * * * *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2020 09:09:36 GMT</pubDate>
    <dc:creator>Danny_Nilsson</dc:creator>
    <dc:date>2020-06-26T09:09:36Z</dc:date>
    <item>
      <title>Powershell and crontab with universal forwarder not working as expected</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-and-crontab-with-universal-forwarder-not-working-as/m-p/506269#M86207</link>
      <description>&lt;P&gt;I have done some really basic testing as i want to prove that this is not working correctly. I have added 3 scripts into a clean input.conf&lt;/P&gt;&lt;P&gt;[powershell://Powershell01]&lt;BR /&gt;script = 'Filetest01' | out-file "c:\temp\filetest01 $(get-date -f "yyyy-MM-dd HH.mm").txt"&lt;BR /&gt;schedule = */5 * * * *&lt;BR /&gt;Index = Sandbox&lt;BR /&gt;Source = Powershell-test01&lt;BR /&gt;Sourcetype = Powershellscript&lt;/P&gt;&lt;P&gt;[powershell://Powershell02]&lt;BR /&gt;script = 'Filetest02' | out-file "c:\temp\filetest02 $(get-date -f "yyyy-MM-dd HH.mm").txt"&lt;BR /&gt;schedule = */5 * * * *&lt;BR /&gt;Index = Sandbox&lt;BR /&gt;Source = Powershell-test02&lt;BR /&gt;Sourcetype = Powershellscript&lt;/P&gt;&lt;P&gt;[powershell://Powershell03]&lt;BR /&gt;script = 'Filetest03' | out-file "c:\temp\filetest03 $(get-date -f "yyyy-MM-dd HH.mm").txt"&lt;BR /&gt;schedule = */5 * * * *&lt;BR /&gt;Index = Sandbox&lt;BR /&gt;Source = Powershell-test03&lt;BR /&gt;Sourcetype = Powershellscript&lt;/P&gt;&lt;P&gt;The log is reporting this when starting the service&lt;/P&gt;&lt;P&gt;06-26-2020 10:06:07.1442893+2 INFO Exiting powershell host script.&lt;BR /&gt;06-26-2020 10:06:22.8073774+2 INFO start splunk-powerhsell.ps1&lt;BR /&gt;06-26-2020 10:06:24.2149136+2 INFO launched disposer&lt;/P&gt;&lt;P&gt;this is the result&lt;/P&gt;&lt;P&gt;1. Filetest01 starts to run as the first job when the service is restart, but non of the other&lt;BR /&gt;2. File should not start 1 sec behind schedule&lt;BR /&gt;3. Some scripts will execute 2 times&lt;BR /&gt;4. Filetest2 was skipped once. it goes from 10 &amp;gt; 20 where it was expected to be each 5 min&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Name LastWriteTime&lt;BR /&gt;---- -------------&lt;BR /&gt;filetest01 2020-06-26 10.06.txt 26-06-2020 10:06:24&lt;BR /&gt;filetest01 2020-06-26 10.14.txt 26-06-2020 10:14:59&lt;BR /&gt;filetest01 2020-06-26 10.19.txt 26-06-2020 10:19:59&lt;BR /&gt;filetest01 2020-06-26 10.20.txt 26-06-2020 10:20:00&lt;BR /&gt;filetest01 2020-06-26 10.29.txt 26-06-2020 10:29:59&lt;BR /&gt;filetest01 2020-06-26 10.34.txt 26-06-2020 10:34:59&lt;BR /&gt;filetest01 2020-06-26 10.35.txt 26-06-2020 10:35:00&lt;BR /&gt;filetest01 2020-06-26 10.44.txt 26-06-2020 10:44:59&lt;BR /&gt;filetest01 2020-06-26 10.49.txt 26-06-2020 10:49:59&lt;BR /&gt;filetest01 2020-06-26 10.50.txt 26-06-2020 10:50:00&lt;BR /&gt;filetest02 2020-06-26 10.09.txt 26-06-2020 10:09:59&lt;BR /&gt;filetest02 2020-06-26 10.10.txt 26-06-2020 10:10:00&lt;BR /&gt;filetest02 2020-06-26 10.19.txt 26-06-2020 10:19:59&lt;BR /&gt;filetest02 2020-06-26 10.24.txt 26-06-2020 10:24:59&lt;BR /&gt;filetest02 2020-06-26 10.25.txt 26-06-2020 10:25:00&lt;BR /&gt;filetest02 2020-06-26 10.34.txt 26-06-2020 10:34:59&lt;BR /&gt;filetest02 2020-06-26 10.39.txt 26-06-2020 10:39:59&lt;BR /&gt;filetest02 2020-06-26 10.40.txt 26-06-2020 10:40:00&lt;BR /&gt;filetest02 2020-06-26 10.49.txt 26-06-2020 10:49:59&lt;BR /&gt;filetest03 2020-06-26 10.09.txt 26-06-2020 10:09:59&lt;BR /&gt;filetest03 2020-06-26 10.14.txt 26-06-2020 10:14:59&lt;BR /&gt;filetest03 2020-06-26 10.15.txt 26-06-2020 10:15:00&lt;BR /&gt;filetest03 2020-06-26 10.24.txt 26-06-2020 10:24:59&lt;BR /&gt;filetest03 2020-06-26 10.29.txt 26-06-2020 10:29:59&lt;BR /&gt;filetest03 2020-06-26 10.30.txt 26-06-2020 10:30:00&lt;BR /&gt;filetest03 2020-06-26 10.39.txt 26-06-2020 10:39:59&lt;BR /&gt;filetest03 2020-06-26 10.44.txt 26-06-2020 10:44:59&lt;BR /&gt;filetest03 2020-06-26 10.45.txt 26-06-2020 10:45:00&lt;/P&gt;&lt;P&gt;UniversalForwarder Version&amp;nbsp;7.0.2.0&lt;/P&gt;&lt;P&gt;Upgraded to Version&amp;nbsp;8.0.4.0&lt;/P&gt;&lt;P&gt;After upgrade it looks good&lt;/P&gt;&lt;P&gt;Name LastWriteTime&lt;BR /&gt;---- -------------&lt;BR /&gt;filetest01 2020-06-26 10.57.txt 26-06-2020 10:57:12&lt;BR /&gt;filetest01 2020-06-26 11.00.txt 26-06-2020 11:00:00&lt;BR /&gt;filetest01 2020-06-26 11.05.txt 26-06-2020 11:05:00&lt;BR /&gt;filetest02 2020-06-26 10.57.txt 26-06-2020 10:57:12&lt;BR /&gt;filetest02 2020-06-26 11.00.txt 26-06-2020 11:00:00&lt;BR /&gt;filetest02 2020-06-26 11.05.txt 26-06-2020 11:05:00&lt;BR /&gt;filetest03 2020-06-26 10.57.txt 26-06-2020 10:57:12&lt;BR /&gt;filetest03 2020-06-26 11.00.txt 26-06-2020 11:00:00&lt;BR /&gt;filetest03 2020-06-26 11.05.txt 26-06-2020 11:05:00&lt;/P&gt;&lt;P&gt;At last i found out this was a problem in the splunk version that was fixed later.&lt;/P&gt;&lt;P&gt;Is it possible to not have Splunk run all scripts when starting the service. as i don't think it support Cron 0/5 * * * *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 09:09:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-and-crontab-with-universal-forwarder-not-working-as/m-p/506269#M86207</guid>
      <dc:creator>Danny_Nilsson</dc:creator>
      <dc:date>2020-06-26T09:09:36Z</dc:date>
    </item>
  </channel>
</rss>

