1. Go to this page and download the library: Download nexylan/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/ */
nexylan / 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);