Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>LogFilterProNew to Visual Studio Code? Get it now.
LogFilterPro

LogFilterPro

zhanwangfeng

|
1 install
| (0) | Free
Pipeline-based log filtering with regex extraction and deduplication
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LogFilter

VS Marketplace Installs

English | 中文

Pipeline-based log filtering for VS Code. Write .lf rule files to filter, extract, and deduplicate log content — preview results instantly.

  • GitHub: https://github.com/zhanwangfeng/LogFilterForVSCode
  • VSCode: https://marketplace.visualstudio.com/items?itemName=zhanwangfeng.logfilterpro

Show

Usage Show

Quick Start

  1. Open any .log file and click CreateLogFilterPro in the editor title bar
  2. Edit the .lf file with rules:
# Comments start with #
ERROR                                    # Keep lines matching regex
\[(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\] # Extract capture groups
!dedupe                                  # Commands start with !
  1. Go back to the .log file and click OpenPreview, or press Ctrl+Enter on any rule in the .lf file

Rule Syntax

Type Description
# comment Line must start with # followed by a space
regex Keep matching lines; if capture groups (), extract only captured content
!command Operate on the entire line set

Commands

Command Description
!dedupe Remove duplicate lines globally
!dedupe-consecutive Remove consecutive duplicates (uniq)
!count Merge duplicates, append count (N)
!count-consecutive Count consecutive duplicates (uniq -c)
!sort Sort lines (-desc, -regex <pattern>, -int, -drop-unmatched, -skip-line <N>)
!pivot Cross-tabulation (-p pattern, -r rows, -c cols, -v values, -f filter, -func aggregator, -view tree\|list\|csv\|tab, -table-view-format compact\|aligned)

Parameters can span continuation lines (indented lines starting with -):

!pivot -p (\d+\.\d+\.\d+\.\d+).*?(\d{2}):
  -n 1:IP
  -n 2:Hour
  -r IP
  -c Hour
  -func count

Pipeline

Each rule's output feeds into the next:

Raw log → Rule 1 → Rule 2 → ... → Preview

Example — extract unique error IPs:

Input:
  ERROR [192.168.1.1] timeout
  INFO  [10.0.0.5]   heartbeat
  ERROR [192.168.1.1] retry

Rule 1: ERROR                        → 2 lines (ERROR only)
Rule 2: \[(\d{1,3}\.\d+\.\d+\.\d+)\] → 2 lines (192.168.1.1, 192.168.1.1)
Rule 3: !dedupe                      → 1 line  (192.168.1.1)

Editor Features

  • CreateLogFilterPro — Create .lf from current .log (editor title button)
  • OpenPreview — Run all rules and show preview
  • ▶ Filter (Ctrl+Enter) — Run from rule 1 to the current line
  • Ctrl+Enter (any line) — Run nearest valid rule above cursor
  • Ctrl+/ — Toggle comment
  • Syntax highlighting — Comments (green), commands (purple), regex (default)

Install

npm install
npm run compile

Press F5 in VS Code to launch an Extension Dev Host.

Or install from the VS Code Marketplace.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft