logstash-plugins/logstash-patterns-core
Healthy across the board
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 2d ago
- ✓39+ active contributors
- ✓Distributed ownership (top contributor 17% of recent commits)
Show 3 more →Show less
- ✓Apache-2.0 licensed
- ✓CI configured
- ✓Tests present
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/logstash-plugins/logstash-patterns-core)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/logstash-plugins/logstash-patterns-core on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: logstash-plugins/logstash-patterns-core
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/logstash-plugins/logstash-patterns-core shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across the board
- Last commit 2d ago
- 39+ active contributors
- Distributed ownership (top contributor 17% of recent commits)
- Apache-2.0 licensed
- CI configured
- Tests present
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live logstash-plugins/logstash-patterns-core
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/logstash-plugins/logstash-patterns-core.
What it runs against: a local clone of logstash-plugins/logstash-patterns-core — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in logstash-plugins/logstash-patterns-core | Confirms the artifact applies here, not a fork |
| 2 | License is still Apache-2.0 | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 32 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of logstash-plugins/logstash-patterns-core. If you don't
# have one yet, run these first:
#
# git clone https://github.com/logstash-plugins/logstash-patterns-core.git
# cd logstash-patterns-core
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of logstash-plugins/logstash-patterns-core and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "logstash-plugins/logstash-patterns-core(\\.git)?\\b" \\
&& ok "origin remote is logstash-plugins/logstash-patterns-core" \\
|| miss "origin remote is not logstash-plugins/logstash-patterns-core (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Apache-2\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Apache-2\\.0\"" package.json 2>/dev/null) \\
&& ok "license is Apache-2.0" \\
|| miss "license drift — was Apache-2.0 at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f "lib/logstash/patterns/core.rb" \\
&& ok "lib/logstash/patterns/core.rb" \\
|| miss "missing critical file: lib/logstash/patterns/core.rb"
test -f "logstash-patterns-core.gemspec" \\
&& ok "logstash-patterns-core.gemspec" \\
|| miss "missing critical file: logstash-patterns-core.gemspec"
test -f "patterns/ecs-v1/grok-patterns" \\
&& ok "patterns/ecs-v1/grok-patterns" \\
|| miss "missing critical file: patterns/ecs-v1/grok-patterns"
test -f "patterns/legacy/grok-patterns" \\
&& ok "patterns/legacy/grok-patterns" \\
|| miss "missing critical file: patterns/legacy/grok-patterns"
test -f "README.md" \\
&& ok "README.md" \\
|| miss "missing critical file: README.md"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 32 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~2d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/logstash-plugins/logstash-patterns-core"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
This is the Logstash Patterns Core plugin: a comprehensive library of Grok pattern definitions that enable the Logstash grok filter to parse and extract structured data from unstructured log messages. It provides 20+ pre-built pattern sets (AWS, HAProxy, Apache httpd, PostgreSQL, MongoDB, Java, Rails, Redis, etc.) in both ECS v1-compliant and legacy formats, eliminating the need for users to write custom regex patterns for common log types. Simple, file-driven architecture: lib/logstash/patterns/core.rb is the Ruby entry point that loads pattern files from patterns/ directory. Patterns are organized by category (aws/, bacula/, httpd/, mongodb/, etc.) with two versions each: ecs-v1/ (Elastic Common Schema v1 compliant) and legacy/ (pre-ECS). Each category has a single file (e.g., patterns/ecs-v1/httpd) containing named Grok pattern definitions (PATTERN_NAME = regex).
👥Who it's for
DevOps engineers, security analysts, and log aggregation specialists using Logstash who need to ingest and parse logs from diverse sources (cloud services, web servers, databases, firewalls) without writing complex regular expressions. Pattern maintainers and contributors to the Elastic ecosystem.
🌱Maturity & risk
Production-ready and actively maintained. The repository shows continuous CI/CD via GitHub Actions (.github/workflows/), a detailed CHANGELOG.md tracking all releases, and a defined contribution process (CONTRIBUTING.md, PR templates). The dual-format pattern structure (ecs-v1/ and legacy/) indicates long-term commitment to backward compatibility while supporting modern standards.
Low risk for core stability—patterns are data (text files, not code) with minimal dependencies, reducing breakage surface. However, this is a utility library: its usefulness depends entirely on Logstash adoption and whether pattern definitions stay current as log formats evolve. Single point of failure for pattern accuracy: community contributions must be carefully reviewed since incorrect patterns will silently fail to match logs.
Active areas of work
The repository shows active maintenance with changelog versioning automation (.github/workflows/changelog-version-update.yml). No specific PR/issue data is visible in the file list, but the presence of GitHub Actions workflows and PR templates indicates ongoing community contributions and release management.
🚀Get running
git clone https://github.com/logstash-plugins/logstash-patterns-core.git
cd logstash-patterns-core
bundle install
bundle exec rspec
Daily commands: This is not a runnable service. To use patterns locally in Logstash development:
bundle install
# Edit your local Logstash Gemfile to reference this gem
gem "logstash-patterns-core", :path => "./logstash-patterns-core"
bin/logstash -e 'filter { grok { patterns_dir => ["./patterns"] match => { "message" => "%{HTTPD_COMBINEDLOG}" } } }'
🗺️Map of the codebase
lib/logstash/patterns/core.rb— Entry point that loads and registers all grok patterns; every contributor must understand how patterns are discovered and exposed to Logstash.logstash-patterns-core.gemspec— Gem specification defining dependencies, versioning, and pattern file inclusion; critical for package distribution.patterns/ecs-v1/grok-patterns— Core grok pattern library in ECS v1 format; the most fundamental pattern definitions used by the filter.patterns/legacy/grok-patterns— Legacy pattern definitions maintained for backward compatibility; understand differences from ECS-v1 when debugging pattern issues.README.md— Documents plugin purpose, development workflow, and testing approach; essential onboarding reference.spec/spec_helper.rb— Test infrastructure setup; defines how pattern matching tests are executed and validated.Rakefile— Build automation and test execution; understand how to run the pattern test suite locally.
🧩Components & responsibilities
- lib/logstash/patterns/core.rb (Ruby, File I/O) — Entry point; discovers and registers all grok patterns from ecs-v1/ and legacy/ directories; exposes patterns to Logstash grok filter plugin
- Failure mode: If pattern files are missing or unreadable, plugin fails to load; grok filter cannot parse logs
- patterns/ecs-v1/ (pattern files)* (Grok regex syntax, ECS field naming) — Canonical grok pattern definitions conforming to ECS schema; covers httpd, syslog, java, aws, databases, etc.
- Failure mode: Syntax errors in patterns cause grok parsing failures; incorrect regex causes silent non-matches or partial extractions
- patterns/legacy/ (pattern files)* — undefined
🛠️How to make changes
Add a new grok pattern
- Open the appropriate pattern file in patterns/ecs-v1/ directory based on log type (e.g., httpd, java, aws) (
patterns/ecs-v1/grok-patterns) - Add your pattern definition using grok syntax: PATTERNNAME (?<fieldname>regex_expression) (
patterns/ecs-v1/grok-patterns) - Create or update a corresponding test file in spec/patterns/ (e.g., new_service_spec.rb) with test cases (
spec/patterns/core_spec.rb) - Run tests with
bundle exec rake specto validate pattern matching against real log samples (Rakefile) - Patterns are automatically loaded by lib/logstash/patterns/core.rb; no additional registration needed (
lib/logstash/patterns/core.rb)
Maintain backward compatibility with legacy patterns
- If fixing a bug in an existing pattern, update both patterns/ecs-v1 and patterns/legacy versions (
patterns/ecs-v1/grok-patterns) - Document breaking changes in CHANGELOG.md with migration path for users (
CHANGELOG.md) - Add tests for both ECS-v1 and legacy pattern variants to ensure compatibility (
spec/patterns/core_spec.rb) - Both pattern sets are loaded; users can choose ecs-v1 (recommended) or legacy via Logstash config (
lib/logstash/patterns/core.rb)
Add patterns for a new application type
- Create new subdirectory under patterns/ecs-v1/ (e.g., patterns/ecs-v1/newapp/) (
patterns/ecs-v1) - Define patterns file with application-specific grok rules, organized by log entry type (
patterns/ecs-v1/grok-patterns) - Create spec/patterns/newapp_spec.rb with test cases against real log samples from that application (
spec/patterns/httpd_spec.rb) - Update logstash-patterns-core.gemspec to include the new pattern files in gem_files glob pattern (
logstash-patterns-core.gemspec) - Run full test suite to ensure no pattern conflicts and all tests pass (
Rakefile)
🔧Why these technologies
- Grok (pattern syntax) — Industry-standard log parsing language; allows composable, reusable regex-based patterns for complex log formats without writing raw regex.
- Elastic Common Schema (ECS) v1 — Standardized field naming and structure; enables consistency across Logstash deployments and log aggregation in Elastic Stack.
- RSpec — Ruby testing framework aligned with Logstash ecosystem; enables data-driven pattern validation against real log samples.
- Ruby gem packaging — Integrates seamlessly with Logstash's plugin architecture; simplifies distribution and dependency management.
⚖️Trade-offs already made
-
Maintain both ecs-v1 and legacy pattern sets
- Why: Backward compatibility; existing users rely on legacy patterns without breaking changes.
- Consequence: Doubled maintenance burden for pattern bug fixes; increased gem size; potential for divergence if not carefully synchronized.
-
Patterns are static files loaded at plugin initialization
- Why: Performance; patterns compiled once at startup, enabling fast log parsing at runtime.
- Consequence: Pattern changes require Logstash restart; no dynamic pattern reloading; users cannot define custom patterns at runtime via plugin.
-
Granular pattern files by application type (httpd/, java/, aws/, etc.)
- Why: Organization and maintainability; clear separation of concerns; easier to find and test domain-specific patterns.
- Consequence: Users must understand which pattern file contains relevant rules; discovery overhead; no single 'catch-all' pattern file.
🚫Non-goals (don't propose these)
- Dynamic pattern generation or AI-driven pattern discovery
- Real-time pattern validation or conflict detection
- Multi-language pattern syntax support (grok-only)
- Pattern performance benchmarking or optimization tooling
- Custom field type coercion or data transformation beyond pattern capture
🪤Traps & gotchas
No environment variables or service dependencies required. One non-obvious aspect: ECS v1 patterns and legacy patterns are duplicate definitions in separate directories—when contributing, you must update BOTH ecs-v1/{category} and legacy/{category} files with the same pattern name (else plugin users expecting backward compatibility will break). Pattern syntax is Grok regex, not standard PCRE—subtle differences in syntax (e.g., %{PATTERN} syntax for composition) can silently fail to match.
🏗️Architecture
💡Concepts to learn
- Grok Pattern Matching — Grok is the syntax used to define and compose regex patterns for log parsing in this library—understanding %{PATTERN_NAME} composition and named capture groups is essential to reading/writing patterns
- Elastic Common Schema (ECS) — The ecs-v1/ pattern directory conforms to ECS, a standardized field naming convention (source.ip, destination.port, etc.)—knowing ECS ensures new patterns are compatible with ECS-compliant Logstash deployments
- Pattern Composition and Inheritance — Patterns reference other patterns (e.g., HTTPD_COMBINEDLOG uses IP, USERNAME, etc.) forming a dependency tree—changes to base patterns in grok-patterns affect many downstream patterns
- Named Capture Groups — Grok uses (?<field_name>regex) syntax to extract structured fields from logs—understanding capture group naming is critical to pattern correctness and ECS field mapping
- Regex Backtracking and Performance — Complex Grok patterns with overlapping alternatives can cause catastrophic backtracking on large log volumes—pattern authors must balance expressiveness with Logstash performance
- Backward Compatibility via Legacy Patterns — This repo maintains both ecs-v1 and legacy pattern directories—understanding version management ensures new patterns don't break existing Logstash configs relying on legacy pattern names
🔗Related repos
elastic/logstash— Main Logstash repository that consumes these patterns via the grok filter plugin—this is a dependency of Logstash, not standalonelogstash-plugins/logstash-filter-grok— The grok filter plugin that executes these pattern definitions—tight coupling; pattern changes must be compatible with grok filter versionselastic/ecs— Elastic Common Schema specification that the ecs-v1/ patterns conform to—defines the standard field names (source.ip, destination.port, etc.) used in pattern definitionslogstash-plugins/logstash-patterns-java— Companion patterns library for Java/JVM logs—shows how specialized pattern sets are distributed as separate gems alongside core patternslogstash-plugins/logstash-input-file— Common input plugin paired with grok filter in typical Logstash pipelines for reading log files that need pattern parsing
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive test coverage for ECS-v1 patterns
The repo has patterns/ecs-v1/ directory with multiple pattern files (aws, bacula, bind, bro, exim, firewalls, grok-patterns, haproxy, httpd, java, junos, linux-syslog, maven, mcollective, mongodb, nagios, postgresql, rails, redis, ruby, squid, zeek) but spec/patterns/ only shows tests for a subset of these. ECS-v1 is the current standard and needs full test coverage to ensure pattern compatibility and prevent regressions.
- [ ] Review spec/patterns/ directory and identify which ECS-v1 patterns lack test files (e.g., spec/patterns/zeek_spec.rb, spec/patterns/mcollective_spec.rb, spec/patterns/mongodb_spec.rb, spec/patterns/nagios_spec.rb, spec/patterns/postgresql_spec.rb, spec/patterns/rails_spec.rb, spec/patterns/redis_spec.rb, spec/patterns/ruby_spec.rb, spec/patterns/squid_spec.rb)
- [ ] For each missing test file, create a spec file that tests representative log samples against the corresponding pattern files in patterns/ecs-v1/
- [ ] Ensure test coverage follows the same format as existing specs like spec/patterns/aws_spec.rb and spec/patterns/bacula_spec.rb
Add GitHub Actions workflow for automated pattern validation
The repo has .github/workflows/changelog-version-update.yml but no pattern validation workflow. Currently only .travis.yml exists. A GitHub Actions workflow should validate that all patterns in patterns/ecs-v1/ and patterns/legacy/ are syntactically correct Grok patterns and run the test suite on each commit, improving CI reliability and eliminating Travis dependency.
- [ ] Create .github/workflows/pattern-validation.yml that runs 'rake spec' (from Rakefile) on push and pull requests
- [ ] Add a pattern syntax validator step that checks all files in patterns/ecs-v1/ and patterns/legacy/ directories for invalid Grok syntax
- [ ] Configure the workflow to run on Ruby versions specified in gemspec to ensure compatibility
Create missing spec tests for legacy patterns and document pattern migration guide
The repo maintains both patterns/legacy/ and patterns/ecs-v1/ directories, but there's no documentation explaining the differences or migration path. Additionally, legacy pattern tests appear to be missing (spec/patterns/ has no legacy-specific test files). This creates confusion for users and makes it harder to maintain backward compatibility.
- [ ] Add a PATTERNS_MIGRATION.md file documenting which legacy patterns correspond to ECS-v1 patterns and key differences
- [ ] Create spec tests for critical legacy patterns (e.g., spec/patterns/legacy_grok_patterns_spec.rb) to ensure backward compatibility isn't broken
- [ ] Update README.md to recommend ECS-v1 patterns for new users while explaining when legacy patterns should be used
🌿Good first issues
- Add missing test coverage for patterns in patterns/ecs-v1/zeek and patterns/legacy/zeek directories—Zeek IDS logs are complex; writing spec files to validate common Zeek log formats (DNS, HTTP, SSL events) would catch regex typos before release.
- Harmonize pattern naming consistency across categories—audit patterns/ecs-v1/firewalls and patterns/legacy/firewalls to ensure naming follows ECS field conventions (e.g., source.ip, dest.ip) and document the naming standard in README.md with examples.
- Add documentation/examples for new pattern contributors showing how to add a pattern for a custom application—create a docs/PATTERN_WRITING_GUIDE.md with a worked example (e.g., parsing custom JSON logs or Kubernetes events) with before/after Grok regex.
⭐Top contributors
Click to expand
Top contributors
- @ph — 17 commits
- @kares — 12 commits
- @jsvd — 10 commits
- @colinsurprenant — 6 commits
- @bdashrad — 6 commits
📝Recent commits
Click to expand
Recent commits
cfd8884— [skip ci] Add version file, update gemspec, and add Changelog & Version Update workflow trigger (alexcams)f01f3f3— fix CISCOFW302013_302014_302015_302016 grok pattern (#313) (leandrojmp)15e125d— Fix: parsing x-edge-location in CLOUDFRONT_ACCESS_LOG (#311) (kares)cd84000— Fix: typo in BIN9_QUERYLOG pattern (in ECS mode) (#307) (camAtGitHub)a01f322— Test: fix and add ECS compatibility specs (#310) (kares)5b9a287— Chore: Fix broken link on readme. (#305) (garnertb)7f94275— Fix: incorrect syslog (priority) field name (#303) (kares)dc33cb5— Build: revert the need to use a git source (#302) (kares)8381e7a— Feat: fully ECS compliant captures (#297) (kares)3b0ea51— Refactor: move patterns under (legacy) sub-dir (kares)
🔒Security observations
This repository demonstrates a strong security posture. As a Logstash pattern definitions plugin, it contains primarily configuration pattern files and test specifications rather than executable code with complex logic. No hardcoded secrets, suspicious credentials, or dangerous code patterns were identified. The project uses Apache 2.0 license and maintains standard GitHub security practices (.github/ISSUE_TEMPLATE.md, PULL_REQUEST_TEMPLATE.md). Dependencies were not provided for analysis, but the codebase itself is low-risk. The primary concern is minor documentation completeness. Recommendations: (1) Ensure all dependencies are regularly updated and scanned with tools like Dependabot, (2) Complete README documentation, (3) Maintain regular security audits of pattern definitions to prevent regex-based DoS (ReDoS) vulnerabilities in grok patterns.
- Low · Incomplete README Documentation —
README.md. The README.md file appears to be truncated mid-sentence ('Need he' instead of 'Need Help?'), which could indicate incomplete or rushed documentation. While not a direct security issue, poor documentation can lead to misuse of the plugin. Fix: Complete and review the README.md file to ensure all documentation is clear and comprehensive.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.