<?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 Python SDK resulting in split values for stats in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-resulting-in-split-values-for-stats/m-p/459808#M8374</link>
    <description>&lt;P&gt;We're currently using the python sdk to hit the API to run some queries. These are all stats functions to generate metrics for our systems every week. We're running into a strange issue where Splunk is returning the correct values, but splitting them up into multiple fields.&lt;/P&gt;

&lt;P&gt;Expected Data (And what we see in splunk web)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ServiceName                TotalCount                    ResponseTime
PingService                   100,000                          10ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What we actually get is something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ServiceName                 TotalCount                ResponseTime
PingService                    99,987                        10ms
PingService                        13                        14ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The total sum ends up being correct, but for some reason it is splitting up the events into separate rows. What could be causing this issue?&lt;/P&gt;

&lt;P&gt;The code we use to hit the SDK is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;HOST = 
PORT = 
USERNAME = 
PASSWORD = 
APPLICATION = 
service = client.connect(
        host = HOST,
        port = PORT,
        username = USERNAME,
        password = PASSWORD)

kwargs_export = {"earliest_time": "-170hour", 
              "latest_time": "-2hour", 
                "search_mode": "normal", 
                "count" : 0} 

searchquery_export = 'long query ending with stats'
job = service.jobs.create(searchquery_export, **kwargs_export)

#While Loop to check and print the status of the job - code cut for brevity


reader = results.ResultsReader(job.results(**kwargs_export))    

reultList = []
for result in reader:
    if isinstance(result, dict):
        resultDict=dict(result)
        reultList.append(resultDict)
job.cancel()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Nov 2018 22:04:23 GMT</pubDate>
    <dc:creator>brajaram</dc:creator>
    <dc:date>2018-11-06T22:04:23Z</dc:date>
    <item>
      <title>Python SDK resulting in split values for stats</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-resulting-in-split-values-for-stats/m-p/459808#M8374</link>
      <description>&lt;P&gt;We're currently using the python sdk to hit the API to run some queries. These are all stats functions to generate metrics for our systems every week. We're running into a strange issue where Splunk is returning the correct values, but splitting them up into multiple fields.&lt;/P&gt;

&lt;P&gt;Expected Data (And what we see in splunk web)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ServiceName                TotalCount                    ResponseTime
PingService                   100,000                          10ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What we actually get is something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ServiceName                 TotalCount                ResponseTime
PingService                    99,987                        10ms
PingService                        13                        14ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The total sum ends up being correct, but for some reason it is splitting up the events into separate rows. What could be causing this issue?&lt;/P&gt;

&lt;P&gt;The code we use to hit the SDK is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;HOST = 
PORT = 
USERNAME = 
PASSWORD = 
APPLICATION = 
service = client.connect(
        host = HOST,
        port = PORT,
        username = USERNAME,
        password = PASSWORD)

kwargs_export = {"earliest_time": "-170hour", 
              "latest_time": "-2hour", 
                "search_mode": "normal", 
                "count" : 0} 

searchquery_export = 'long query ending with stats'
job = service.jobs.create(searchquery_export, **kwargs_export)

#While Loop to check and print the status of the job - code cut for brevity


reader = results.ResultsReader(job.results(**kwargs_export))    

reultList = []
for result in reader:
    if isinstance(result, dict):
        resultDict=dict(result)
        reultList.append(resultDict)
job.cancel()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 22:04:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-resulting-in-split-values-for-stats/m-p/459808#M8374</guid>
      <dc:creator>brajaram</dc:creator>
      <dc:date>2018-11-06T22:04:23Z</dc:date>
    </item>
  </channel>
</rss>

