<?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 add scripts as data input? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373254#M67648</link>
    <description>&lt;P&gt;@niketnilay I'm a little lost. What do you mean by configuring the execution of Scripted input. I thought all I have to do is place the file into search/bin folder and it should run. What could I do to configure this? Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 24 Mar 2018 03:47:36 GMT</pubDate>
    <dc:creator>tamduong16</dc:creator>
    <dc:date>2018-03-24T03:47:36Z</dc:date>
    <item>
      <title>How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373247#M67641</link>
      <description>&lt;P&gt;This is my first time dealing with script input. I tried to place my python script in both of these directories (C:\Program Files\Splunk\bin\scripts, C:\Program Files\Splunk\etc\apps\search\bin) and it hasn't work. I run in python idle and the scripts actually index data into my splunk enviroment. But when I want to add it as a script input, I don't get anything back. It looks like python script never been run. Did I have it in the right file? I didn't create a splunk app for this. What can I do inorder for it to be run in splunk? Here is my &lt;A href="https://answers.splunk.comstorage/temp/229816-testscript.zip"&gt;python script&lt;/A&gt;. Thanks so much!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 21:17:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373247#M67641</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2018-03-22T21:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373248#M67642</link>
      <description>&lt;P&gt;@tamduong16 if your python script is working on its own and you have configured/scheduled the execution of Scripted input which is enabled, I am surprised as to why nothing is being indexed (success or exception log). However, I would request you to push some checkpoint information from your script to Splunk's _internal index using &lt;CODE&gt;sys.stderror.write()&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sys.stderr.write("Python script is starting up\n")       
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also try to search in internal index for any other metrics captured for your scripted input when you have setup the same.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 06:29:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373248#M67642</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-23T06:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373249#M67643</link>
      <description>&lt;P&gt;Alternative way is&lt;BR /&gt;
You can get the output of script and save that in the log file without splunk&lt;BR /&gt;
Then input the log file generated to splunk&lt;BR /&gt;
Which is very easy way&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 06:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373249#M67643</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-23T06:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373250#M67644</link>
      <description>&lt;P&gt;It seems to me, that you don't have enabled the script itself. Have you configured an &lt;CODE&gt;inputs.conf&lt;/CODE&gt;  in the local folder of your search App?&lt;BR /&gt;
And have you an entry in the inputs.conf like this? (modified for windows support):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@monsterine ✓  09:53 $ cat inputs.conf
[script://.\bin\cfgpull_srv.py]
disabled = false
index = main
interval = 60
source = cfgpull_srv.py
sourcetype = cfgpull_srv_stdout
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Mar 2018 08:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373250#M67644</guid>
      <dc:creator>Elsurion</dc:creator>
      <dc:date>2018-03-23T08:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373251#M67645</link>
      <description>&lt;P&gt;i have mentioned alternative as you are facing issue.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 09:12:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373251#M67645</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-23T09:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373252#M67646</link>
      <description>&lt;P&gt;what if he likes it the splunk way?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 09:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373252#M67646</guid>
      <dc:creator>Elsurion</dc:creator>
      <dc:date>2018-03-23T09:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373253#M67647</link>
      <description>&lt;P&gt;@Elsurion I think that's what I'm missing. Since I don't know anything about this. All I did was placing the file inside of the search/bin and expecting it to run on it own. How can I do this? What do I have to do in my input.conf file? I'm very new to this. Thanks for the help&lt;/P&gt;</description>
      <pubDate>Sat, 24 Mar 2018 03:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373253#M67647</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2018-03-24T03:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373254#M67648</link>
      <description>&lt;P&gt;@niketnilay I'm a little lost. What do you mean by configuring the execution of Scripted input. I thought all I have to do is place the file into search/bin folder and it should run. What could I do to configure this? Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 24 Mar 2018 03:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373254#M67648</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2018-03-24T03:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373255#M67649</link>
      <description>&lt;P&gt;@tamduong16, yes you need to configure Data Input similar to how you would setup File Monitor, Performance Monitors etc. Splunk would need to know what to read, from where to read and how frequently to read, where to index and setting up source/sourcetype etc. These you would need to configure in &lt;CODE&gt;inputs.conf&lt;/CODE&gt; either through Splunk Web or CLI. Refer to the documentation: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Getdatafromscriptedinputs#Add_a_scripted_input_in_Splunk_Web"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Getdatafromscriptedinputs#Add_a_scripted_input_in_Splunk_Web&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also read about Writing Reliable scripts documentation, as most of the time scripted inputs have a wrapper script as well as maintain your own last indexed data/recovery/parallel execution etc: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptSetup"&gt;https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptSetup&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Once you have completely tested and made your scripted input robust for your scenario, you may be able to build an Add on using &lt;A href="http://dev.splunk.com/view/addon-builder/SP-CAAAE83"&gt;Splunk Add On Builder&lt;/A&gt; or move towards creating your &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ModInputsIntro"&gt;Modular Input to Splunk&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 24 Mar 2018 04:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373255#M67649</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-24T04:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373256#M67650</link>
      <description>&lt;P&gt;@logloganathan, setting up a scripted input through web is a matter of few clicks and sets up the &lt;CODE&gt;inputs.conf&lt;/CODE&gt; appropriately.&lt;/P&gt;

&lt;P&gt;What you are calling a easy way is actually roundabout. Since after logging data to a file, file monitor input needs to be configured exactly the same way scripted input needs to be setup. Also script will have to be modified to write to a log file as additional change.&lt;/P&gt;

&lt;P&gt;Also scripted input capability to ingest data directly to Splunk. Most of the times it is requirement as well as necessity (for example compliance to not to store unencrypted data as flat file). Imagine DB Connect Input or HTTP Event Collector writing to log file and then ingesting to Splunk.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Mar 2018 04:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/373256#M67650</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-24T04:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add scripts as data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/550785#M91444</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I hope you feel good. I have a little question which deals with "Getting Data in" to Splunk with an url.&amp;nbsp; I understood that I have to write a python scipt for that, but I don't know how to do that, and where I have to include&amp;nbsp; thois script.&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;Have a good day&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 10:57:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-scripts-as-data-input/m-p/550785#M91444</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2021-05-07T10:57:59Z</dc:date>
    </item>
  </channel>
</rss>

