I want to send an array of data (if it can´t be done with arrays I wouldn´t mind converting it to object) to my Elasticsearch index. I used to send my array to a database in MySQL and then load it to Elasticsearch using logstash. I don´t need the database anymore so I was hoping to accomplish this without it, but I couldn,t find good documentation/examples for it in PHP. Any help is apreciated.
This is how I generate the array ($values[]), it has 3 parameters $exec_time (decimal), $name (text) and $date (datetime):
for($i=0; $i<50;++$i){
$date = date('Y-m-d H:i:s');
if($name == "local")
$i = $i + 4;
$ch = $_SESSION['cURL'];
$time_pre = microtime(true);
$data = curl_exec($ch);
$time_pro = microtime(true);
$exec_time = $time_pro - $time_pre;
$values[$i] = "('$exec_time', '$name', '$date')";
}