<?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: Python SDK Visualization in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-Visualization/m-p/198582#M2678</link>
    <description>&lt;P&gt;Hi, i'm just learning t as well, anyway you can put your result in xml file, parse the xml and use (for example flotchart) to represent the result. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;def get_data(self):


        DATA = []

        params = {"earliest_time" : "-30d", "latest_time" : "now", "exec_mode" : "blocking", "auto_cancel" : 600 }
        search = 'search index=main sourcetype=syslog | search *ERROR* | stats count by process' 
        job = service.jobs.create(search, **params)
        #job = service.jobs.create(search)

        while True: 
          if job.isDone: 
            break 
        content = str(job.results(output_mode='xml'))
        #print "Output: %s" % content

        with open('result.xml', 'w') as f:
            f.write(content)

        tree = ET.parse('result.xml')
        root = tree.getroot()

        for child in root:
            if child[0].tag != "fieldOrder":
                #print child[0][0][0].text, child[1][0][0].text
                DATA.append([child[0][0][0].text, child[1][0][0].text])

        return DATA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you have to put the return DATA in flotchart. To know how to use flotchart: &lt;BR /&gt;
search flotchart on web (it seems i can not insert link)&lt;/P&gt;</description>
    <pubDate>Sat, 25 Jan 2014 13:26:38 GMT</pubDate>
    <dc:creator>maurelio79</dc:creator>
    <dc:date>2014-01-25T13:26:38Z</dc:date>
    <item>
      <title>Python SDK Visualization</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-Visualization/m-p/198581#M2677</link>
      <description>&lt;P&gt;Hi to all,&lt;/P&gt;

&lt;P&gt;How to produce a visualization in splunk sdk python? For example pie charts, line graph, and etc.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2014 03:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-Visualization/m-p/198581#M2677</guid>
      <dc:creator>leordimalanta</dc:creator>
      <dc:date>2014-01-09T03:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK Visualization</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-Visualization/m-p/198582#M2678</link>
      <description>&lt;P&gt;Hi, i'm just learning t as well, anyway you can put your result in xml file, parse the xml and use (for example flotchart) to represent the result. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;def get_data(self):


        DATA = []

        params = {"earliest_time" : "-30d", "latest_time" : "now", "exec_mode" : "blocking", "auto_cancel" : 600 }
        search = 'search index=main sourcetype=syslog | search *ERROR* | stats count by process' 
        job = service.jobs.create(search, **params)
        #job = service.jobs.create(search)

        while True: 
          if job.isDone: 
            break 
        content = str(job.results(output_mode='xml'))
        #print "Output: %s" % content

        with open('result.xml', 'w') as f:
            f.write(content)

        tree = ET.parse('result.xml')
        root = tree.getroot()

        for child in root:
            if child[0].tag != "fieldOrder":
                #print child[0][0][0].text, child[1][0][0].text
                DATA.append([child[0][0][0].text, child[1][0][0].text])

        return DATA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you have to put the return DATA in flotchart. To know how to use flotchart: &lt;BR /&gt;
search flotchart on web (it seems i can not insert link)&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jan 2014 13:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-Visualization/m-p/198582#M2678</guid>
      <dc:creator>maurelio79</dc:creator>
      <dc:date>2014-01-25T13:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK Visualization</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-Visualization/m-p/198583#M2679</link>
      <description>&lt;P&gt;Thank you! I will try this to my next project!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2014 06:31:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-Visualization/m-p/198583#M2679</guid>
      <dc:creator>leordimalanta</dc:creator>
      <dc:date>2014-02-03T06:31:12Z</dc:date>
    </item>
  </channel>
</rss>

