PHPackages                             tsuijie/php-grok - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tsuijie/php-grok

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

tsuijie/php-grok
================

Logstash Grok compatible log parser for PHP.

v1.0.0(7y ago)41.2kMITPHPPHP &gt;=7.3.0CI failing

Since Jun 11Pushed 7y agoCompare

[ Source](https://github.com/tsuijie/php-grok)[ Packagist](https://packagist.org/packages/tsuijie/php-grok)[ Docs](https://github.com/tsuijie/php-grok)[ RSS](/packages/tsuijie-php-grok/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

php-grok
========

[](#php-grok)

Logstash Grok compatible log parser for PHP

Requirements
============

[](#requirements)

This simple code is made available by recent fix for php discussed here: [php/php-src#2044](https://github.com/php/php-src/pull/2044) .

Thus it only works for php version &gt;= 7.3.0 .

The extension `mb-string` is also required obviously.

Install
=======

[](#install)

```
composer require tsuijie/php-grok

```

Example
=======

[](#example)

```
use Tsuijie\PHPGrok\Grok;

$g = new Grok;
$g->addPatternsFromPath();
$array = $g->match('%{COMMONAPACHELOG}', '0.0.0.0 - - [17/May/2015:10:05:03 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"');

print_r($array);

```

Tests
=====

[](#tests)

Run the tests using phpunit:

```
phpunit --configuration phpunit.xml.dist

```

License
=======

[](#license)

[MIT license](https://opensource.org/licenses/MIT).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2575d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5970965?v=4)[Tsui Jie](/maintainers/TsuiJie)[@tsuijie](https://github.com/tsuijie)

---

Tags

grok

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tsuijie-php-grok/health.svg)

```
[![Health](https://phpackages.com/badges/tsuijie-php-grok/health.svg)](https://phpackages.com/packages/tsuijie-php-grok)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

112.9k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
