Skip to content

About

Laravel package that utilizes the Graylog messages API to search for messages

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Laravel Graylog

GitHub Tests Action Status GitHub Code Style Action Status

Laravel package that utilizes the Graylog messages API to search for messages

Installation

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-graylog

You 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'),
];

Usage

Get Cluster Info

\Rpungello\Graylog\Facades\Graylog::cluster();

Run a Search

\Rpungello\Graylog\Facades\Graylog::search(
    '000000000000',
    new \Rpungello\Graylog\TimeRange\Relative(new \Carbon\CarbonInterval(weeks: 4)),
    'field:value && other_field:other_value',
    ['field1', 'field2']
);

Count Results

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'
);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Laravel package that utilizes the Graylog messages API to search for messages

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages