<?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 Fetching data in splunk using API in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Fetching-data-in-splunk-using-API/m-p/540783#M90521</link>
    <description>&lt;P&gt;Hi Team,&lt;BR /&gt;I need suggestion please, I want to import XML data to Splunk using below py script&lt;/P&gt;&lt;P&gt;My concerns are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Can I directly configure&amp;nbsp; py script output to index data in Splunk using inputs.conf, or first I need to save output 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.&lt;/LI&gt;&lt;LI&gt;2)How can I configure that .py file to fetch data in every 5 min.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;CODE :&lt;/P&gt;&lt;P&gt;import requests&lt;BR /&gt;import xmltodict&lt;BR /&gt;import json&lt;BR /&gt;&lt;BR /&gt;url = "&lt;A href="https://www.w3schools.com/xml/plant_catalog.xml" target="_blank"&gt;https://www.w3schools.com/xml/plant_catalog.xml&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;response = requests.get(url)&lt;BR /&gt;content=xmltodict.parse(response.text)&lt;BR /&gt;print(content)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2021 08:38:38 GMT</pubDate>
    <dc:creator>anujsharma19109</dc:creator>
    <dc:date>2021-02-22T08:38:38Z</dc:date>
    <item>
      <title>Fetching data in splunk using API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Fetching-data-in-splunk-using-API/m-p/540783#M90521</link>
      <description>&lt;P&gt;Hi Team,&lt;BR /&gt;I need suggestion please, I want to import XML data to Splunk using below py script&lt;/P&gt;&lt;P&gt;My concerns are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Can I directly configure&amp;nbsp; py script output to index data in Splunk using inputs.conf, or first I need to save output 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.&lt;/LI&gt;&lt;LI&gt;2)How can I configure that .py file to fetch data in every 5 min.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;CODE :&lt;/P&gt;&lt;P&gt;import requests&lt;BR /&gt;import xmltodict&lt;BR /&gt;import json&lt;BR /&gt;&lt;BR /&gt;url = "&lt;A href="https://www.w3schools.com/xml/plant_catalog.xml" target="_blank"&gt;https://www.w3schools.com/xml/plant_catalog.xml&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;response = requests.get(url)&lt;BR /&gt;content=xmltodict.parse(response.text)&lt;BR /&gt;print(content)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 08:38:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Fetching-data-in-splunk-using-API/m-p/540783#M90521</guid>
      <dc:creator>anujsharma19109</dc:creator>
      <dc:date>2021-02-22T08:38:38Z</dc:date>
    </item>
  </channel>
</rss>

