Laravel package that utilizes the Graylog messages API to search for messages
You can install the package via composer, but first you need to add my composer repository to your composer.json file:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.rpun.dev"
}
]
}Then you can install the package:
composer require rpungello/laravel-graylogYou can publish the config file with:
php artisan vendor:publish --tag="graylog-config"This is the contents of the published config file:
return [
'https' => env('GRAYLOG_API_HTTPS', false),
'host' => env('GRAYLOG_API_HOST'),
'port' => env('GRAYLOG_API_PORT', 9000),
'token' => env('GRAYLOG_API_TOKEN'),
];\Rpungello\Graylog\Facades\Graylog::cluster();\Rpungello\Graylog\Facades\Graylog::search(
'000000000000',
new \Rpungello\Graylog\TimeRange\Relative(new \Carbon\CarbonInterval(weeks: 4)),
'field:value && other_field:other_value',
['field1', 'field2']
);Runs a search, but instead of retrieving the data, simply returns the number of matching records
\Rpungello\Graylog\Facades\Graylog::countResults(
'000000000000',
new \Rpungello\Graylog\TimeRange\Relative(new \Carbon\CarbonInterval(weeks: 4)),
'field:value && other_field:other_value'
);composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.