<?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: Using CURLP PHP to export results in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305426#M57638</link>
    <description>&lt;P&gt;I write here complete answer if someone need.&lt;/P&gt;

&lt;P&gt;As already wrote the correct query  to curl and export results  with PHP is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://localhost:8089/services/search/jobs//results/?output_mode=csv&amp;amp;count=50000" target="test_blank"&gt;https://localhost:8089/services/search/jobs//results/?output_mode=csv&amp;amp;count=50000&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, the root cause of the results truncated to 10.000 was the sort in the table, solved with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort 0 &amp;lt;field&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2018 16:12:24 GMT</pubDate>
    <dc:creator>maurelio79</dc:creator>
    <dc:date>2018-01-16T16:12:24Z</dc:date>
    <item>
      <title>Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305420#M57632</link>
      <description>&lt;P&gt;Hi to all, i'm trying to export result with php curl using this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -u admin:changeme \
     -k https://localhost:8089/servicesNS/admin/search/jobs/1423855196.339/results/ \
     --get -d output_mode=csv-d count=5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I made different try in php, but i'm not able to pass parameter like output_mode and count.&lt;BR /&gt;
If i try with CURLOPT_POST and CURLOPT_POSTFIELDS i get "Method Not Allowed"&lt;/P&gt;

&lt;P&gt;Can someone help me please?&lt;/P&gt;

&lt;P&gt;Thanks and regards.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:38:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305420#M57632</guid>
      <dc:creator>maurelio79</dc:creator>
      <dc:date>2020-09-29T17:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305421#M57633</link>
      <description>&lt;P&gt;If i am not wrong there is &lt;CODE&gt;space&lt;/CODE&gt; between &lt;CODE&gt;output_mode=csv&lt;/CODE&gt; and &lt;CODE&gt;-d count=5&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 13:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305421#M57633</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-13T13:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305422#M57634</link>
      <description>&lt;P&gt;At the end i was able to do the php curl with a simple GET and  calling&lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/search/jobs//results/?output_mode=csv&amp;amp;count=50000"&gt;https://localhost:8089/services/search/jobs//results/?output_mode=csv&amp;amp;count=50000&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Now the problem is that i get just 10.000 results (should be more than 18.000)&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 15:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305422#M57634</guid>
      <dc:creator>maurelio79</dc:creator>
      <dc:date>2018-01-13T15:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305423#M57635</link>
      <description>&lt;P&gt;Ohk whats is your search? &lt;BR /&gt;
And do you get the same numberof results into splunk as well?&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 15:19:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305423#M57635</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-13T15:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305424#M57636</link>
      <description>&lt;P&gt;Also set &lt;BR /&gt;
this is from the limits.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [restapi]
 maxresultrows = &amp;lt;integer&amp;gt;
 * Maximum result rows to be returned by /events or /results getters from REST API.
 * Defaults to 50000.
As you can see, there is a limit configured.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You have two options now:&lt;/P&gt;

&lt;P&gt;1) Enhance the limit to a value that is suitable for you.&lt;BR /&gt;
2) I think the better option is to repeat your call with a different offset. You split up your requests on this way. Take a look into the answer of this post:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/25411/upper-limit-for-rest-api-limits-conf-maxresultrows.html"&gt;http://answers.splunk.com/answers/25411/upper-limit-for-rest-api-limits-conf-maxresultrows.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 15:25:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305424#M57636</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-13T15:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305425#M57637</link>
      <description>&lt;P&gt;Default in limits.conf is 50000.  Search is an inputlookup | table and it returns more than 18.000&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 15:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305425#M57637</guid>
      <dc:creator>maurelio79</dc:creator>
      <dc:date>2018-01-13T15:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305426#M57638</link>
      <description>&lt;P&gt;I write here complete answer if someone need.&lt;/P&gt;

&lt;P&gt;As already wrote the correct query  to curl and export results  with PHP is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://localhost:8089/services/search/jobs//results/?output_mode=csv&amp;amp;count=50000" target="test_blank"&gt;https://localhost:8089/services/search/jobs//results/?output_mode=csv&amp;amp;count=50000&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, the root cause of the results truncated to 10.000 was the sort in the table, solved with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort 0 &amp;lt;field&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:12:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305426#M57638</guid>
      <dc:creator>maurelio79</dc:creator>
      <dc:date>2018-01-16T16:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using CURLP PHP to export results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305427#M57639</link>
      <description>&lt;P&gt;Hey &lt;BR /&gt;
Sort by default gives 10k results if you want unlimited results then you should use &lt;CODE&gt;sort limit=0&lt;/CODE&gt;&lt;BR /&gt;
I hope this helps you!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:22:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-CURLP-PHP-to-export-results/m-p/305427#M57639</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-16T16:22:46Z</dc:date>
    </item>
  </channel>
</rss>

