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(6y ago)41.2k↓100%MITPHPPHP &gt;=7.3.0CI failing

Since Jun 11Pushed 6y 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 2mo ago

READMEChangelog (1)DependenciesVersions (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 54% 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

2525d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5251bb3881c1f21023bf1411ecbec552541f8ba892c1229920b5a6ca06c7d846?d=identicon)[TsuiJie](/maintainers/TsuiJie)

---

Tags

grok

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

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M283](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M344](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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