1. Go to this page and download the library: Download deltasystems/graylog-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
deltasystems / graylog-sdk example snippets
$graylog = new \Nexy\Graylog\Graylog([
'base_uri' => 'https://your.graylog.instance.com/api'
]);
// You may authenticate with API token:
$graylog->auth('YourApiToken');
// Or user credentials:
$graylog->auth('YourGraylogUsername', 'YourGrayLogPassword');
// Then, start using the API:
$result = $graylog->search()->relative()->terms('file', 'source: host.com', 0);