{{ pattern }}
| Metric | Value | Copy |
|---|---|---|
| {{ row.label }} | {{ row.value }} | |
| No metrics available. | ||
| Field | Pattern | Example | Type | Copy |
|---|---|---|---|---|
| {{ field.name }} | {{ field.pattern }} | {{ field.sample || '—' }} | {{ field.type }} | |
| No captured fields detected. | ||||
| Sample | Status | Captured | Coverage | Copy |
|---|---|---|---|---|
| #{{ row.index }} · {{ row.snippet }} |
{{ row.status === 'matched' ? 'Matched' : row.status === 'failed' ? 'No match' : row.status === 'error' ? 'Error' : 'Blank' }}
{{ row.message }}
Fields:
{{ field.name }}={{ field.value }},
, ...
|
{{ row.capturedCount }} | {{ (row.coverage || 0).toFixed(1) }}% | |
| No samples analysed yet. | ||||
Grok patterns are reusable match expressions for log messages that turn unstructured lines into labeled fields you can search. Filebeat uses them to extract time, severity, paths, and other details from common web and system logs. Many teams look for a simple grok pattern generator for Nginx or Apache when they want fast results.
Provide a representative line and you get a proposed pattern with captured fields and a clear sense of coverage. You can start from an Apache format, an ingress gateway style, or a classic syslog sample and then refine the result.
Results are designed to be scanned quickly so you can decide what to keep and what to ignore. A short sample is fine for a first pass, and a larger paste gives a clearer picture of match quality.
For example, a line with a timestamp, a level of INFO, a path of /api/items, and a status of 200 yields captures for time, level, path, and status, plus a message tail. That makes it easy to route fields to dashboards without manual regex work.
Logs often carry surprises and a match can still miss a corner case, so review the coverage and make small edits until the fields reflect your intent. Prefer stable keys and consistent quoting to keep patterns sturdy.
Log lines are text records that often contain timestamps, levels, IP addresses, Uniform Resource Locators (URL), user agents, and free text. Field names in the output follow Elastic Common Schema conventions, for example http.request.method, url.path, and log.level.
The generator assembles a Grok expression by detecting a timestamp, scanning for key=value fragments, classifying positional tokens such as methods and status codes, and escaping the literal separators between them. Recognized keys map to canonical ECS fields, while unfamiliar keys can be normalized into a dotted form.
Each run reports a pattern string, an estimated confidence label, known‑field coverage, and a table of captured fields. Coverage indicates how many captures align with well known ECS concepts; higher values usually need fewer custom mappings.
Presets include Apache HTTP combined, Nginx ingress, and Syslog (RFC 3164). Timestamps are detected as ISO 8601 or RFC 3339 date‑times, HTTP date strings, classic syslog stamps, or epoch milliseconds depending on the hint you select.
key=value pairs, map known keys to ECS, and infer simple types.^ and $, and output the pattern.| Token | Meaning | Datatype | Typical ECS Field |
|---|---|---|---|
TIMESTAMP_ISO8601 |
ISO 8601 or RFC 3339 timestamp | timestamp | @timestamp |
HTTPDATE |
HTTP date string | timestamp | @timestamp |
SYSLOGTIMESTAMP |
Syslog style timestamp | timestamp | @timestamp |
EPOCHTIMESTAMP |
Epoch seconds or millis | number | @timestamp |
WORD / NUMBER |
Alphanumeric or numeric token | text / int / float | http.request.method, http.response.status_code |
IP / HOSTNAME |
Address or host label | ip / text | source.ip, host.name |
URIPATH / URIPATHPARAM |
Path with optional query | text | url.path |
QUOTEDSTRING / GREEDYDATA |
Quoted fragment or message tail | text | user_agent.original, message |
2024-10-20T14:52:11Z ... level=INFO ... path=/api/items status=200 →
captures include @timestamp, log.level, url.path, and http.response.status_code, with the remainder as message. A high coverage score means most captures map to known ECS fields.
| Input Key | Canonical Field |
|---|---|
level, severity, loglevel |
log.level |
status, status_code |
http.response.status_code |
method, verb, request_method |
http.request.method |
path, route |
url.path |
url, uri |
url.original |
agent, user_agent |
user_agent.original |
app, program |
service.name or process.name |
pid, process_id |
process.pid |
| Parameter | Meaning | Datatype | Typical Range | Notes |
|---|---|---|---|---|
timestamp_hint |
Bias timestamp detection | enum | auto, iso8601, httpdate, syslog, epoch | Improves disambiguation in mixed formats |
normalize_fields |
Apply ECS‑style field names | boolean | true / false | Unknown keys become custom.* |
detect_pairs |
Scan for key=value tokens |
boolean | true / false | Quoted values are supported |
infer_types |
Cast numbers and booleans | boolean | true / false | Adds :int, :float, :long suffixes |
field_prefix |
Optional dotted prefix | string | e.g., event. |
Not applied to @ fields |
include_pipeline |
Emit ingest pipeline JSON | boolean | true / false | Uses the generated pattern |
match_field |
Source field grok reads | string | default message |
Used in pipeline export |
module_tag |
Optional module hint | string | e.g., custom |
Adds event.module in export |
batch |
Process every non‑empty line | boolean | true / false | Up to 200 lines per run |
ms, s, m, h.Processing runs in the browser. Clipboard copy, file download, and local file reads do not transmit data to a server. A charting layer may be loaded by the host page.
key=value with optional quotes, not nested pairscustom.* when normalization is on:int or :float by simple patternsParsing is browser‑based and no server‑side storage is performed. Logs may contain sensitive data; review organizational policies before sharing examples.
Log patterns for Filebeat grok capture are built from a single representative line or a batch of lines.
Your pattern is now ready to use in an ingest pipeline or for further tuning.
No. Parsing and evaluation run in the browser, and downloads use local file generation. Review the exported JSON or DOCX locally before sharing.
Accuracy depends on the representativeness of your sample. Coverage and confidence help judge fit. Use batch analysis to expose edge cases early.
ISO 8601 or RFC 3339 date‑times, HTTP date strings, syslog timestamps, and 10 to 13 digit epoch values can be detected.
Yes. Set the match field when exporting the ingest pipeline. The default is message.
Select the Nginx ingress preset, paste a typical line, and adjust options. Confirm that status, bytes, upstream address, and request ID are captured.
It indicates many fields are custom or weakly classified. Consider adding stable keys, turning on normalization, or simplifying the message tail.
Once loaded, the generator runs locally. Any optional charting libraries may require network access on first load by the host page.
The fragment describes behavior only. Refer to your deployment’s licensing and terms for usage of the surrounding platform and any third‑party libraries.
event.original.