<?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 How do I import json module? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-import-json-module/m-p/229178#M44577</link>
    <description>&lt;P&gt;i am trying to write a python script to get data from a external API. &lt;BR /&gt;
When I execute the script in Splunk, it fails on json.&lt;/P&gt;

&lt;P&gt;The basic format of the script is  -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys
import requests
import json
import splunk.Intersplunk as si
.
.
.

token_url = base_url+'/security/getToken'
payload = {'xxx': key,'yyy': user,'zzz': pwd}
r = requests.post(token_url, json = payload)
token = r.text.replace('"',"")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I import the json module?&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2017 19:33:48 GMT</pubDate>
    <dc:creator>scottrunyon</dc:creator>
    <dc:date>2017-01-13T19:33:48Z</dc:date>
    <item>
      <title>How do I import json module?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-import-json-module/m-p/229178#M44577</link>
      <description>&lt;P&gt;i am trying to write a python script to get data from a external API. &lt;BR /&gt;
When I execute the script in Splunk, it fails on json.&lt;/P&gt;

&lt;P&gt;The basic format of the script is  -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys
import requests
import json
import splunk.Intersplunk as si
.
.
.

token_url = base_url+'/security/getToken'
payload = {'xxx': key,'yyy': user,'zzz': pwd}
r = requests.post(token_url, json = payload)
token = r.text.replace('"',"")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I import the json module?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 19:33:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-import-json-module/m-p/229178#M44577</guid>
      <dc:creator>scottrunyon</dc:creator>
      <dc:date>2017-01-13T19:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import json module?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-import-json-module/m-p/229179#M44578</link>
      <description>&lt;P&gt;To solve this problem, I set up a Windows bat file to execute a .py file that saves the data into a json file on the local drive.  Splunk monitors this file without any issues.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 19:47:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-import-json-module/m-p/229179#M44578</guid>
      <dc:creator>scottrunyon</dc:creator>
      <dc:date>2017-08-21T19:47:18Z</dc:date>
    </item>
  </channel>
</rss>

