Skip to content

Comparison to MS Log Parser 2.2

This guide helps users migrating from Microsoft Log Parser 2.2 understand the differences and compatibility with loq.

Overview

loq aims to be a drop-in replacement for MS Log Parser 2.2 with these goals:

  • 100% CLI compatibility - Same command-line syntax
  • 2-5x performance - Built in Rust for speed
  • Cross-platform - Runs on Windows, macOS, Linux
  • Extended features - Window functions, full subqueries, more formats

Feature Comparison

FeatureMS Log Parser 2.2loq
PlatformWindows onlyWindows, macOS, Linux
PerformanceBaseline2-5x faster
CLI Syntax-i:FORMAT -o:FORMATSame (compatible)
COM/ScriptingYesWindows DLL available
REST APINoYes
Container SupportNoDocker, Kubernetes

SQL Features

FeatureMS Log Parser 2.2loq
SELECT, WHERE, LIMITYesYes
GROUP BY, HAVINGYesYes
ORDER BYYesYes
DISTINCTYesYes
INNER JOINYesYes
LEFT JOINLimitedYes
CROSS JOINNoYes
UNIONLimitedFull support
Subqueries (IN)BasicFull support
Subqueries (scalar)NoYes
Subqueries (EXISTS)NoYes
Window FunctionsNoYes
CASE WHENBasicFull support

Input Formats

FormatMS Log Parser 2.2loq
CSVYesYes
TSVYesYes
XMLYesYes
JSONNoYes
W3C (IIS)YesYes
IIS NativeYesYes
NCSA/ApacheYesYes
EVTXWindows onlyCross-platform
RegistryWindows onlyCross-platform (.reg)
SyslogNoYes (RFC 3164/5424)
S3NoYes
ParquetNoYes
PCAPNoYes

Output Formats

FormatMS Log Parser 2.2loq
CSVYesYes
TSVYesYes
XMLYesYes
JSONNoYes
IISYesYes
DATAGRIDYesYes
SQLiteNoYes
PostgreSQLNoYes
MySQLNoYes
CHARTYesYes (PNG/SVG)
TemplateYesYes
CloudWatchNoYes

CLI Compatibility

loq uses the same CLI syntax as MS Log Parser 2.2:

bash
# MS Log Parser 2.2
loq.exe -i:W3C -o:CSV "SELECT * FROM ex*.log"

# loq (identical)
loq -i:W3C -o:CSV "SELECT * FROM ex*.log"

Supported Options

OptionMS Log ParserloqNotes
-i:FORMATYesYesInput format
-o:FORMATYesYesOutput format
-q:ON/OFFYesYesQuiet mode
-stats:ON/OFFYesYesShow statistics
-headers:ON/OFFYesYesInclude headers
-recurse:NYesYesRecursive depth
-iCodepage:CPYesYesInput codepage
-oCodepage:CPYesYesOutput codepage
-oSeparator:SEPYesYesOutput separator
file:query.sqlYesYesQuery from file

New Options

loq adds these new options:

OptionDescription
--ofile PATHOutput file path
--otable NAMEDatabase table name
--followStreaming mode (tail -f style)
-chartType:TYPEChart type (Bar, Line, Pie)
-chartTitle:TITLEChart title

Migration Guide

Simple Queries

Most queries work unchanged:

bash
# MS Log Parser 2.2
loq "SELECT * FROM data.csv WHERE age > 30"

# loq
loq "SELECT * FROM data.csv WHERE age > 30"

Format Options

Format options are compatible:

bash
# MS Log Parser 2.2
loq -i:IISW3C -o:CSV "SELECT date, cs-uri-stem FROM ex*.log"

# loq
loq -i:W3C -o:CSV "SELECT date, cs-uri-stem FROM ex*.log"

Format Aliases

loq supports multiple aliases for formats:

  • W3C, IISW3C both work
  • NCSA, APACHE, NGINX all work
  • DATAGRID, TABLE, GRID all work

Functions

Most functions are compatible:

MS Log ParserloqNotes
UPPER(s)UPPER(s)Same
LOWER(s)LOWER(s)Same
SUBSTR(s,n,m)SUBSTR(s,n,m)Same
STRLEN(s)STRLEN(s) or LENGTH(s)Both work
TO_TIMESTAMP(s,f)TO_TIMESTAMP(s,f)Same
QUANTIZE(ts,n)QUANTIZE(ts,n)Same
EXTRACT_PREFIX(s,d)EXTRACT_PREFIX(s,d)Same
REVERSEDNS(ip)REVERSEDNS(ip)Same

COM/Scripting Migration

If you used MS Log Parser via COM (VBScript, PowerShell), loq provides:

  1. Windows DLL - COM-compatible interface for existing scripts
  2. REST API - HTTP interface for any language

PowerShell Example

MS Log Parser (COM):

powershell
$logParser = New-Object -ComObject MSUtil.LogQuery
$rs = $logParser.Execute("SELECT * FROM data.csv")

loq (REST API):

powershell
$body = @{ sql = "SELECT * FROM data.csv" } | ConvertTo-Json
$result = Invoke-RestMethod -Uri "http://localhost:8080/api/v1/query" `
    -Method Post -Body $body -ContentType "application/json"

Differences to Note

1. File Paths

loq is more flexible with file paths:

bash
# Both work
loq "SELECT * FROM data.csv"
loq "SELECT * FROM 'data.csv'"
loq "SELECT * FROM '/path/to/data.csv'"  # Absolute paths

2. Date/Time Handling

loq returns ISO 8601 format by default:

bash
# MS Log Parser might return: 01/15/2024
# loq returns: 2024-01-15T14:30:00

3. NULL Handling

loq has explicit NULL support:

sql
-- Works in loq
SELECT COALESCE(name, 'Unknown') FROM data.csv
SELECT * FROM data.csv WHERE email IS NULL

4. Case Sensitivity

loq is case-insensitive for SQL keywords but preserves case in data:

sql
-- All equivalent
SELECT name FROM users.csv
select name from users.csv
Select Name From users.csv

New Features in loq

Window Functions

Not available in MS Log Parser:

sql
SELECT name, salary,
       ROW_NUMBER() OVER (ORDER BY salary DESC) as rank,
       RANK() OVER (PARTITION BY dept ORDER BY salary DESC) as dept_rank,
       LAG(salary, 1, 0) OVER (ORDER BY name) as prev_salary
FROM employees.csv

Full Subqueries

Extended subquery support:

sql
-- Scalar subquery
SELECT name, salary,
       salary - (SELECT AVG(salary) FROM employees.csv) as diff_from_avg
FROM employees.csv

-- EXISTS subquery
SELECT * FROM users.csv u
WHERE EXISTS (SELECT 1 FROM orders.csv o WHERE o.user_id = u.id)

Cloud Integration

New in loq:

bash
# Read from S3
loq -i:S3 "SELECT * FROM 's3://bucket/logs/*.csv'"

# Write to CloudWatch
loq -o:CLOUDWATCH --log-group:/app/logs "SELECT * FROM errors.csv"

Container Support

bash
# Run in Docker
docker run --rm -v $(pwd):/data loq "SELECT * FROM /data/logs.csv"

# Deploy to Kubernetes
kubectl apply -f k8s/

Performance Comparison

loq is generally 2-5x faster:

OperationMS Log Parser 2.2loq
Parse 1M CSV rows~10s~3s
Parse 100K W3C records~5s~1.5s
GROUP BY on 1M rows~15s~4s
JOIN two 100K tables~20s~6s

Performance varies based on:

  • File size and format
  • Query complexity
  • Hardware (loq benefits from multiple cores)

Getting Help

All rights reserved.