Skip to main content

AltF Flow recipe

Filter a log file down to its unique errors

To see which distinct errors a log contains, keep only ERROR and FATAL lines, remove the timestamp at the start of each line, replace numbers such as IDs and durations with a placeholder, and remove duplicates. This recipe does that in four steps, turning hundreds of repeated lines into a short list of unique error messages in first-seen order.

  • Free, no sign-up
  • Runs in your browser
  • Nothing uploaded
  • Share recipes as a link

4 steps · runs in your browser · nothing uploaded

Pipeline

  1. Keep, Contains: \\b(ERROR|FATAL)\\b, Regular expression

    9 → 6 lines (-3)
  2. Find: ^\\S+[ T]\\S+\\s+, Regular expression

    6 → 6 lines
  3. Find: \\b\\d+\\b, Replace with: <n>, Regular expression

    6 → 6 lines
  4. Keep the first copy of each line and drop repeats.

    6 → 3 lines (-3)

9lines79words573chars

3lines21words149chars-6 lines vs input

The 4 steps in this recipe

  1. 1

    Filter lines - Keep, Contains: \\b(ERROR|FATAL)\\b, Regular expression

    Keep or remove lines that contain a word or match a pattern.

  2. 2

    Find and replace - Find: ^\\S+[ T]\\S+\\s+, Regular expression

    Replace text everywhere. Supports regular expressions with $1 back-references.

  3. 3

    Find and replace - Find: \\b\\d+\\b, Replace with: <n>, Regular expression

    Replace text everywhere. Supports regular expressions with $1 back-references.

  4. 4

    Remove duplicate lines

    Keep the first copy of each line and drop repeats.

Change any option in the workspace above, switch a step off to compare, or add your own steps. Save it to reuse it, or share the recipe as a link.

Worked example

Before
2026-10-31 09:14:02 INFO  Server started on port 8080
2026-10-31 09:14:05 ERROR Payment failed for order 1042: card declined
2026-10-31 09:14:06 WARN  Slow query took 812 ms
2026-10-31 09:15:11 ERROR Payment failed for order 1077: card declined
2026-10-31 09:15:40 INFO  User 55 signed in
2026-10-31 09:16:02 ERROR Timeout calling https://api.example.com after 30 s
2026-10-31 09:16:30 ERROR Payment failed for order 1093: card declined
2026-10-31 09:17:45 FATAL Database connection lost (pool 2)
2026-10-31 09:18:02 ERROR Timeout calling https://api.example.com after 30 s
After
ERROR Payment failed for order <n>: card declined
ERROR Timeout calling https://api.example.com after <n> s
FATAL Database connection lost (pool <n>)

Why each step is there

  • Filter lines keeps lines with the whole word ERROR or FATAL. Ignore case is off so a message that merely mentions "error" in lowercase is not picked up.
  • The first replace removes the leading date and time, which make every line unique.
  • The second replace turns standalone numbers into <n>, so "order 1042" and "order 1077" become the same message.
  • Remove duplicate lines then leaves one line per distinct error.

Adapting it to your log format

If your timestamps look like [31/Oct/2026:09:14:02 +0000], change the first replace to ^\[[^\]]*\]\s*. To count how often each error happens rather than just listing it, run the recipe without the last step and paste the output into a word frequency counter. Add WARN to the filter pattern to include warnings.

Filter errors from a log: questions and answers

Why mask numbers instead of keeping them?

IDs and durations make otherwise identical errors look different. Delete step 3 if you need the exact values.

Can it handle multi-line stack traces?

Filter lines works line by line, so only the line with the level is kept. Stack frame lines below it are dropped.

How large a log can I paste?

Up to 2 MB per run. For bigger files, cut out the time window you care about first.

More recipes like this

Every step you can add (41)

Clean up

  • Trim whitespace
  • Trim every line
  • Remove empty lines
  • Collapse repeated spaces
  • Remove line breaks
  • Strip HTML tags
  • Straighten smart quotes
  • Remove accents
  • Remove punctuation
  • Remove emoji
  • Remove non-ASCII characters

Change case

  • Change case
  • Make URL slugs

Lines

  • Sort lines
  • Remove duplicate lines
  • Keep only duplicated lines
  • Compare with another list
  • Count repeated lines
  • Reverse line order
  • Shuffle lines
  • Keep a range of lines
  • Truncate long lines
  • Wrap at a width
  • Split into lines
  • Join lines

Find and filter

  • Find and replace
  • Filter lines
  • Remove words or characters

Extract

  • Extract

Data and formats

  • Format JSON
  • Minify JSON
  • CSV to JSON
  • JSON to CSV
  • Lines to JSON array
  • JSON array to lines

Encode and decode

  • Encode or decode

Build output

  • Add prefix / suffix
  • Quote each line
  • Number lines
  • Apply a line template
  • Add timestamp
What each step does, with its options

AltF Flow runs entirely in your browser. Your text is never sent to AltFTool; saved recipes stay in this browser and shared links carry the steps only.