title: fetching data in Splunk using rest api
body: <p>I want to import XML data to Splunk using below .py script</p>
  <p>My concerns are:</p>
  <ol>
  <li>Can I directly configure .py script output to  index data in splunk using inputs.conf, or do I need to save output first into a .csv file. If yes can anyone please suggest some approach so that data does not get changed after storing it into a new .csv file.</li>
  <li>How can I configure that .py file to fetch data in every 5 min.</li>
  </ol>
  <pre><code>import requests
  import xmltodict
  import json
   
  url = &quot;https://www.w3schools.com/xml/plant_catalog.xml&quot;
   
  response = requests.get(url)
  content=xmltodict.parse(response.text)
  print(content)
  </code></pre>