<?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: Search using C# sdk is returning only 50000 events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-using-C-sdk-is-returning-only-50000-events/m-p/117885#M184009</link>
    <description>&lt;P&gt;50,000 events is the default resultset size to return , as set in the maxresultrows property.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/admin/Limitsconf"&gt;See in limits.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It is not recommended to change this.&lt;/P&gt;

&lt;P&gt;Rather , in your SDK code you should implement a paging algorithm.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/view/csharp-sdk/SP-CAAAEQK"&gt;You can reference how to do this in C Sharp here.&lt;/A&gt; Scroll down to the "To paginate through a large set of results" section of the page.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jan 2014 09:16:49 GMT</pubDate>
    <dc:creator>Damien_Dallimor</dc:creator>
    <dc:date>2014-01-17T09:16:49Z</dc:date>
    <item>
      <title>Search using C# sdk is returning only 50000 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-using-C-sdk-is-returning-only-50000-events/m-p/117884#M184008</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;From Splunk web interface a saved search is returning around 300,000+ events. While calling the same saved search from C# SDk it is returning only 50,000 events. &lt;/P&gt;

&lt;P&gt;Please help me on why i am getting only 50,000 events and how can i read remaining events.&lt;/P&gt;

&lt;P&gt;Below is the code that i am referring to.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    var connectArgs = new ServiceArgs
            {
                Host = "myhost.com",
                Port = myportNumber

            };

            // Create new Service object
            Service service = new Service(connectArgs);


            service.Login("admin", "password");


            SavedSearch ObsSearch = service.GetSavedSearches().Get("SavedSearchName");

            Job searchJob = ObsSearch.Dispatch();


            while (!searchJob.IsDone)
            {
                try
                {
                    Thread.Sleep(500);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception Occured :" + ex.ToString());
                    Console.ReadLine();
                }
            }


            JobResultsPreviewArgs previewArgs = new JobResultsPreviewArgs();
            previewArgs.OutputMode = JobResultsPreviewArgs.OutputModeEnum.Xml;
            previewArgs.Count = 0;

            int count = 0;


            using (var stream = searchJob.ResultsPreview(previewArgs))
            {
                using (var rr = new ResultsReaderXml(stream))
                {
                    foreach (var @event in rr)
                    {

                        count ++;
                    }

                }

            }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;System.Console.WriteLine("Total events "   + count.ToString())&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Mohan&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2014 06:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-using-C-sdk-is-returning-only-50000-events/m-p/117884#M184008</guid>
      <dc:creator>ykmohank</dc:creator>
      <dc:date>2014-01-17T06:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search using C# sdk is returning only 50000 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-using-C-sdk-is-returning-only-50000-events/m-p/117885#M184009</link>
      <description>&lt;P&gt;50,000 events is the default resultset size to return , as set in the maxresultrows property.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/admin/Limitsconf"&gt;See in limits.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It is not recommended to change this.&lt;/P&gt;

&lt;P&gt;Rather , in your SDK code you should implement a paging algorithm.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/view/csharp-sdk/SP-CAAAEQK"&gt;You can reference how to do this in C Sharp here.&lt;/A&gt; Scroll down to the "To paginate through a large set of results" section of the page.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2014 09:16:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-using-C-sdk-is-returning-only-50000-events/m-p/117885#M184009</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2014-01-17T09:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Search using C# sdk is returning only 50000 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-using-C-sdk-is-returning-only-50000-events/m-p/117886#M184010</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;BR /&gt;
I tried paginate option and with this i was able to download 500,000 events where as in reality web interface is returning me 703,186 events. &lt;/P&gt;

&lt;P&gt;Is there any other way on getting the remaining records as well.&lt;/P&gt;

&lt;P&gt;Job.ResultCount is returning value as 500,000 only.&lt;/P&gt;

&lt;P&gt;Pelase help.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2014 11:42:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-using-C-sdk-is-returning-only-50000-events/m-p/117886#M184010</guid>
      <dc:creator>ykmohank</dc:creator>
      <dc:date>2014-01-17T11:42:12Z</dc:date>
    </item>
  </channel>
</rss>

