Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have a CakePHP application where I’m calling https://hkrtrainings.com/splunk-api to make a search and obtain its results. It works as a charm when I try it on Postman, but when run by my server it doesn’t return results every time. In fact, when I call the API constantly inside a while loop, it does tend to bring results, although sometimes it could take more 2 minutes to return something.
I’m calling Splunk this way:
$querying = array( “search” => “search index=api_sandbox OR index=api_prod token=” .$token, “output_mode” => “raw” ); $querying = http_build_query($data); try{ $curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://mysplunk:8089/servicesNS/user/environment/search/jobs/export?' . $querying,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYPEER, false,
CURLOPT_USERPWD => 'Basic ' . base64_encode("user:password"),
CURLOPT_HTTPHEADER => array(
'Authorization: Basic ' . base64_encode("user:password")
),
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
$response = curl_exec($curl);
curl_close($curl);
return $response;
}catch (\Throwable $th) {
Log::error("callApi ERR: " . $th->getMessage());
debug("Error: " . $th->getMessage());
return false;
}
The API call is run inside a CakePHP Shell Task, and for the record when executed the Shell Task through console command (php bin/cake.php Queue.Queue runworker) the API does return results without empty results.
Why this strange behavior could be occurring?
2b943a6c5830489f9a3a6e3ade857e
8c5b08bc277a4e1bbfbcdd305aa232
Kailey Ketchum
9c1989c1c80144c7a9977905ce64c9
a6309a057c3f4cb38fb2e7feb67236
a6309a057c3f4cb38fb2e7feb67236
9c1989c1c80144c7a9977905ce64c9
CometAPI001
Rafiq Mohammed shah
05f65dd4216b456c9c89745746f80e
erel