<?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: How to generate logs from a custom Python script? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-generate-logs-from-a-custom-Python-script/m-p/595260#M10589</link>
    <description>&lt;P&gt;Without going into a lot of other settings that you need to apply you can run a rudimentary inputs&lt;/P&gt;&lt;P&gt;Create a splunk app with a structure like this&lt;/P&gt;&lt;P&gt;yoursplunkapp\bin\yourpythonscripthere.py&lt;/P&gt;&lt;P&gt;yoursplunkapp\local\inputs.conf&lt;/P&gt;&lt;P&gt;[script://$SPLUNK_HOME/etc/apps/yoursplunkapp/bin/yourpythonscripthere.py]&lt;BR /&gt;interval = 30&lt;BR /&gt;index=foo&lt;BR /&gt;sourcetype=faa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will run your script every 30 seconds. You can use seconds there or a cron expression.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2022 16:46:12 GMT</pubDate>
    <dc:creator>Azeemering</dc:creator>
    <dc:date>2022-04-25T16:46:12Z</dc:date>
    <item>
      <title>How to generate logs from a custom Python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-generate-logs-from-a-custom-Python-script/m-p/595247#M10588</link>
      <description>&lt;P&gt;Hey there Splunk community. I'm new here and I would appreciate some help if it is possible.&lt;/P&gt;&lt;P&gt;So, I have to create a Splunk&amp;nbsp;app that runs a Python script each day and it&amp;nbsp;should generate random log events and index them into Splunk.&lt;/P&gt;&lt;P&gt;I'm not sure what's the best approach for this. I already wrote a custom script and successfully tested it by implementing it in Splunk (Data Inputs &amp;gt; Scripts...) but I don't know how to run it once a day and get x amount of log events.&lt;/P&gt;&lt;P&gt;I did use Cron schedule for scheduling it once a day but I only get one log event. Is there a way Splunk can run a script x amount of times at once?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 22:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-generate-logs-from-a-custom-Python-script/m-p/595247#M10588</guid>
      <dc:creator>mrrci</dc:creator>
      <dc:date>2022-04-28T22:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate logs from a custom Python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-generate-logs-from-a-custom-Python-script/m-p/595260#M10589</link>
      <description>&lt;P&gt;Without going into a lot of other settings that you need to apply you can run a rudimentary inputs&lt;/P&gt;&lt;P&gt;Create a splunk app with a structure like this&lt;/P&gt;&lt;P&gt;yoursplunkapp\bin\yourpythonscripthere.py&lt;/P&gt;&lt;P&gt;yoursplunkapp\local\inputs.conf&lt;/P&gt;&lt;P&gt;[script://$SPLUNK_HOME/etc/apps/yoursplunkapp/bin/yourpythonscripthere.py]&lt;BR /&gt;interval = 30&lt;BR /&gt;index=foo&lt;BR /&gt;sourcetype=faa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will run your script every 30 seconds. You can use seconds there or a cron expression.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 16:46:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-generate-logs-from-a-custom-Python-script/m-p/595260#M10589</guid>
      <dc:creator>Azeemering</dc:creator>
      <dc:date>2022-04-25T16:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate logs from a custom Python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-generate-logs-from-a-custom-Python-script/m-p/595281#M10590</link>
      <description>&lt;P&gt;I did experiment with Cron scheduling but it doesn't really solve my problem. As I said, I need to execute it multiple times at once. Let's say I need to run that script 100 000 consecutive times in a row. I didn't find anything to do it.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 17:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-generate-logs-from-a-custom-Python-script/m-p/595281#M10590</guid>
      <dc:creator>mrrci</dc:creator>
      <dc:date>2022-04-25T17:52:01Z</dc:date>
    </item>
  </channel>
</rss>

