Skip to content

Instantly share code, notes, and snippets.

@Java4all
Created March 13, 2026 00:55
Show Gist options
  • Select an option

  • Save Java4all/b97b3c1b42e9ea85283e300de89774b8 to your computer and use it in GitHub Desktop.

Select an option

Save Java4all/b97b3c1b42e9ea85283e300de89774b8 to your computer and use it in GitHub Desktop.
pattern
pipeline:
# ── Your actual service tag names ─────────────────────────────────────────
# Must match exactly what appears before the colon in your log lines.
# Log line: [2024-01-15T10:00:15.123z] service-exec: docker()
# Tag: service-exec
static_tags:
- "service-exec" # ← replace with your real tag names
- "service-deploy"
- "service-test"
# ── Method start pattern ──────────────────────────────────────────────────
# Matches the line that begins a method call.
# {tag} is replaced with each entry from static_tags above.
# Uses re.search() -- matches anywhere in line, timestamps/prefixes ignored.
#
# Your log: [2024-01-15T10:00:15.123z] service-exec: docker()
# Captured: "docker" (group 1)
#
# Default captures word chars only ([\w_]+), which strips the ()
# That's intentional -- the timing line uses docker() but capture is "docker"
# and timing pattern also strips () so they match each other correctly.
method_start_pattern: "{tag}:\\s*([\\w_]+)"
# ── Timing end pattern ────────────────────────────────────────────────────
# Matches the line that ends a method call and records its elapsed time.
# Uses re.search() -- matches anywhere in line.
#
# Your log: method_1:time-elapsed-seconds:10
# Your log: docker():time-elapsed-seconds:111
# Captured: ("method_1", "10") / ("docker", "111")
#
# The \(?\)? part handles both docker() and docker variants.
timing_pattern: "([\\w_]+)\\s*\\(?\\)?:time-elapsed-seconds:([\\d.]+)"
# ── Stage pattern ─────────────────────────────────────────────────────────
# Matches a stage boundary line. Stage is optional -- if not present in
# your logs all methods go into an "ungrouped" bucket.
#
# Your log: [2024-01-15T10:00:15.123z] StageName: Build
# Captured: "Build"
stage_pattern: "StageName:\\s*(.+)"
# ── Timestamp extraction pattern ──────────────────────────────────────────
# Only used to extract the timestamp VALUE for display -- not used for
# pattern matching, so you don't need to change this unless your format differs.
#
# Matches: [2024-01-15T10:00:15.123z] [2024-01-15T10:00:15z]
timestamp_pattern: "\\[(\\d{4}-\\d{2}-\\d{2}T[\\d:.]+z?)\\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment