Hi,
We have configured ELK for our server logs.
We want to query elasticsearch using PHP. Below is our code:
//Change URL Accordingly
$elasticServer = ["172.29.106.202:9200"]; //Server IP / Name
//Create Elastic Search Object
$client = Elasticsearch\ClientBuilder::create()
->setHosts($elasticServer)
->setRetries(0)
->build();
$result = new stdClass();
$params = array();
$params['index'] = '*'; //search all index
$params['type'] = 'Beta Logs from 51.66';
$params['body']['query']['match']['message'] = "Action:read_session";
$result->searches = $client->search($params);
This returns a set of data. But however, the data returned is not similar to what I get from Kibana UI.
Any explanation? or change in the code?