<?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: Using a Python script to call an API in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337136#M62255</link>
    <description>&lt;P&gt;Thanks Damien. I will take a look at this on Friday.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Nov 2017 20:38:36 GMT</pubDate>
    <dc:creator>bazcurtis178</dc:creator>
    <dc:date>2017-11-07T20:38:36Z</dc:date>
    <item>
      <title>Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337127#M62246</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to use the Sophos Central API. It uses a Python script to download the data into a file. I have successfully run this on my Mac, but I am not sure where to start in Splunk. I thought I would drop the script in $SPLUNK_HOME/bin/scripts, but the script is not seen.&lt;/P&gt;

&lt;P&gt;I assume Splunk will then look at the downloaded file and index it?&lt;/P&gt;

&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 11:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337127#M62246</guid>
      <dc:creator>bazcurtis178</dc:creator>
      <dc:date>2017-10-28T11:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337128#M62247</link>
      <description>&lt;P&gt;Check out inputs.conf section regarding scripted inputs.  &lt;/P&gt;

&lt;P&gt;The scripted input indexes whatever is coming to stdout.  &lt;/P&gt;

&lt;P&gt;If your script downloads data to a file, perhaps a slight modification would make it print the data to stdout.&lt;/P&gt;

&lt;P&gt;Another option is making the script run as a cron job and then using splunk inputs.conf monitor stanza to monitor the location that the script is putting data files into.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 12:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337128#M62247</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-10-28T12:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337129#M62248</link>
      <description>&lt;P&gt;Thanks for the reply. My first issue is getting the script to run. How do I get the script add to at least run once?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 14:43:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337129#M62248</guid>
      <dc:creator>bazcurtis178</dc:creator>
      <dc:date>2017-10-28T14:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337130#M62249</link>
      <description>&lt;P&gt;Having a quick look at the docs , &lt;A href="https://community.sophos.com/kb/en-us/125169/"&gt;https://community.sophos.com/kb/en-us/125169/&lt;/A&gt; and the example script , &lt;A href="https://github.com/sophos/Sophos-Central-SIEM-Integration"&gt;https://github.com/sophos/Sophos-Central-SIEM-Integration&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It would be very easy to use the &lt;A href="https://splunkbase.splunk.com/app/1546/"&gt;REST API Modular Input&lt;/A&gt; and setup an input with Sophos URL , Auth headers, Checkpointing etc.. as detailed in the docs and skip the need to save a downloaded file to disk and rather just stream this data directly in to Splunk.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 18:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337130#M62249</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2017-10-28T18:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337131#M62250</link>
      <description>&lt;P&gt;This link does a pretty good job of explaining it:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://sublimerobots.com/2017/01/simple-splunk-scripted-input-example/"&gt;https://sublimerobots.com/2017/01/simple-splunk-scripted-input-example/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The inputs.conf tells splunk to execute the script based on whatever interval you provide.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 20:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337131#M62250</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-10-28T20:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337132#M62251</link>
      <description>&lt;P&gt;Thanks for the replies. I will take a look at that and confirm the answer once tested. I like the look of the Rest API. I was hoping to get the data straight in to Splunk rather than download the file and get the data from there.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 17:33:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337132#M62251</guid>
      <dc:creator>bazcurtis178</dc:creator>
      <dc:date>2017-10-30T17:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337133#M62252</link>
      <description>&lt;P&gt;That’s exactly what the rest api modular input would do.  Same for a scripted input writing to stdout.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 18:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337133#M62252</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-10-30T18:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337134#M62253</link>
      <description>&lt;P&gt;I have finally got back to this. Sorry for all the questions, but I appreciate the help.&lt;/P&gt;

&lt;P&gt;I assumed that I would paste in the Header API key or API Access URL + Headers into the setup page, but I am not seeing a place for that. The URL is obvious, but where do the API tokens go? With only two to choose from I thought it would be simple?&lt;/P&gt;

&lt;P&gt;Any other pointers would be most welcome.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 17:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337134#M62253</guid>
      <dc:creator>bazcurtis178</dc:creator>
      <dc:date>2017-11-06T17:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337135#M62254</link>
      <description>&lt;P&gt;I have underlined where you enter  1) URL  2) HTTP Header propertys  3) URL parameters&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3747iEF0D0106195294CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 23:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337135#M62254</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2017-11-06T23:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Python script to call an API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337136#M62255</link>
      <description>&lt;P&gt;Thanks Damien. I will take a look at this on Friday.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:38:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-Python-script-to-call-an-API/m-p/337136#M62255</guid>
      <dc:creator>bazcurtis178</dc:creator>
      <dc:date>2017-11-07T20:38:36Z</dc:date>
    </item>
  </channel>
</rss>

