<?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 Stats search in SDK: Receiving task cancelled error in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-search-in-SDK-Receiving-task-cancelled-error/m-p/475349#M133602</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I am trying to run stats splunk search using c# SDK and getting task cancelled error. &lt;BR /&gt;
Kindly help me on this. I have tried with/without sleep too.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
await service.LogOnAsync("USERNAME", "PASSWORD");
                Job job = await service.Jobs.CreateAsync("search index=windows_inetpub cs_uri_stem=\"*/search\" | stats count", 10);
                SearchResultStream stream;

                while (!job.IsDone)
                {
                    Thread.Sleep(1000);
                }

                using (stream = await job.GetSearchResultsAsync(1))
                {
                    try
                    {
                        foreach (SearchResult result in stream)
                        {
                            Console.WriteLine(string.Format("{0:D8}: {1}", stream.ReadCount, result));
                        }

                        Console.WriteLine("End of search results");
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(string.Format("SearchResults error: {0}", e.Message));
                    }
                }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help on this will be more helpfull.&lt;/P&gt;

&lt;P&gt;Thank you,&lt;BR /&gt;
Suresh Kumar G.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Nov 2019 20:42:34 GMT</pubDate>
    <dc:creator>gsureshkumarcse</dc:creator>
    <dc:date>2019-11-04T20:42:34Z</dc:date>
    <item>
      <title>Stats search in SDK: Receiving task cancelled error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-search-in-SDK-Receiving-task-cancelled-error/m-p/475349#M133602</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I am trying to run stats splunk search using c# SDK and getting task cancelled error. &lt;BR /&gt;
Kindly help me on this. I have tried with/without sleep too.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
await service.LogOnAsync("USERNAME", "PASSWORD");
                Job job = await service.Jobs.CreateAsync("search index=windows_inetpub cs_uri_stem=\"*/search\" | stats count", 10);
                SearchResultStream stream;

                while (!job.IsDone)
                {
                    Thread.Sleep(1000);
                }

                using (stream = await job.GetSearchResultsAsync(1))
                {
                    try
                    {
                        foreach (SearchResult result in stream)
                        {
                            Console.WriteLine(string.Format("{0:D8}: {1}", stream.ReadCount, result));
                        }

                        Console.WriteLine("End of search results");
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(string.Format("SearchResults error: {0}", e.Message));
                    }
                }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help on this will be more helpfull.&lt;/P&gt;

&lt;P&gt;Thank you,&lt;BR /&gt;
Suresh Kumar G.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 20:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-search-in-SDK-Receiving-task-cancelled-error/m-p/475349#M133602</guid>
      <dc:creator>gsureshkumarcse</dc:creator>
      <dc:date>2019-11-04T20:42:34Z</dc:date>
    </item>
  </channel>
</rss>

