Download the PHP package debugrammer/php-graylog-query-builder without Composer
On this page you can find all versions of the php package debugrammer/php-graylog-query-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download debugrammer/php-graylog-query-builder
More information about debugrammer/php-graylog-query-builder
Files in debugrammer/php-graylog-query-builder
Package php-graylog-query-builder
Short Description Graylog Search Query Builder for Graylog REST API
License MIT
Homepage https://github.com/debugrammer/php-graylog-query-builder
Informations about the package php-graylog-query-builder
Graylog Query Builder for PHP
PHP version of Graylog Search Query Builder especially useful for working with Graylog REST API.
Getting Started
PHP versions 7.0 up to PHP 7.4 are currently supported. Graylog Query Builder for PHP is recommended to use composer to install the library.
Add php-graylog-query-builder to composer.json
either by running composer:
or by defining it manually:
Usage
Above code snippet generates the string below.
Building Queries
1. Statements
1.1. Term
Messages that include the term or phrase.
Usage:
Output:
1.2. Fuzz Term
Messages that include similar term or phrase.
1.2.1. Fuzziness with default distance
Usage:
Output:
1.2.2. Fuzziness with custom distance
Usage:
Output:
1.3. Exists
Messages that have the field.
Usage:
Output:
1.4. Field
1.4.1. Field (String)
Messages where the field includes the term or phrase.
Usage:
Output:
1.4.2. Field (Numeric)
Messages where the field includes the number.
Usage:
Output:
1.4.3. One side unbounded range query
Messages where the field satisfies the condition.
Usage:
Output:
1.5. Fuzz Field
Messages where the field includes similar term or phrase.
1.5.1. Fuzziness with default distance
Usage:
Output:
1.5.2. Fuzziness with custom distance
Usage:
Output:
1.6. Range
1.6.1. Range query
Ranges in square brackets are inclusive, curly brackets are exclusive and can even be combined.
Usage:
Output:
1.6.2. Date range query
The dates needs to be UTC.
Usage:
Output:
1.6. Raw
Raw query.
Usage:
Output:
2. Conjunctions
2.1. And
Usage:
Output:
2.2. Or
Usage:
Output:
2.3. Not
Usage:
Output:
3. Parentheses
Usage:
Output:
Advanced Usage
Sometimes you might want to compose dynamic queries by condition.
1. Prepend Graylog query
Usage:
Output:
2. Append Graylog query
Usage:
Output: