Exporting Windows PerfMon Counters to Text Format for Excel Analysis (BLG to TXT Conversion)


11 views

When working with Windows Reliability and Performance Monitor (PerfMon) version 6.0+, you'll notice the tool defaults to saving performance counter data in BLG (Binary Log) format. While efficient for the monitoring tool itself, this binary format creates headaches when you need to:

  • Perform custom analysis in Excel
  • Process data through scripts
  • Share reports with non-technical stakeholders

The most straightforward solution is using Microsoft's built-in relog.exe utility. This command-line tool ships with Windows and can convert BLG files to various formats:

rem Basic conversion to CSV (Excel-friendly)
relog "C:\perfdata\server_perf.blg" -f CSV -o "C:\output\perf_counters.csv"

rem Advanced example with counter filtering
relog "input.blg" -f TSV -o "output.txt" -c "\Processor(_Total)\% Processor Time" "\Memory\Available MBytes"

For regular reporting needs, PowerShell provides more flexibility:

# Convert and import directly into Excel
$blgPath = "C:\monitoring\daily_metrics.blg"
$csvOutput = "C:\reports\$(Get-Date -Format 'yyyyMMdd')_perf.csv"

& relog $blgPath -f CSV -o $csvOutput

# Optional: Open in Excel
Start-Process excel.exe -ArgumentList $csvOutput

If you control the initial data collection, configure PerfMon to log directly to text:

  1. Create a new Data Collector Set
  2. Add your performance counters
  3. In "Data Manager" settings, enable "Save data in report format"
  4. Set report format to "Comma Separated"

When dealing with multi-GB BLG files, consider these optimizations:

rem Split processing by time range
relog "large_file.blg" -b "01/01/2023 00:00:00" -e "01/01/2023 23:59:59" -f CSV -o daily_slice.csv

rem Reduce precision to decrease file size
relog "input.blg" -f CSV -o "light_output.csv" -y

For enterprise environments, combine this with Task Scheduler to automate nightly conversions of performance logs.


When working with Windows Reliability and Performance Monitor (PerfMon) version 6.0, the default output format is BLG (binary log). While efficient for system performance, this format isn't directly compatible with Excel for data analysis. Here's how to transform this into a more accessible text format.

Windows includes the powerful relog.exe command-line tool for converting performance logs:

rem Convert BLG to CSV (comma-separated values)
relog "C:\perflogs\System_Overview.blg" -f csv -o "C:\output\perf_data.csv"

Key parameters:

  • -f csv: Specifies CSV output format
  • -o: Defines output file location
  • Optional: -y suppresses confirmation prompts

For more control over the output format, use this PowerShell script:

# Import the Performance Data Helper library
Add-Type -Path "C:\Windows\System32\pdh.dll"

# Define input and output paths
$blgPath = "C:\perflogs\Processor.blg"
$txtPath = "C:\output\processor_data.txt"

# Convert using PDH functions
$query = New-Object System.Diagnostics.PerformanceCounter
$query.OpenExistingLog($blgPath)
$counters = $query.GetCounters()
$counters | Export-Csv -Path $txtPath -Delimiter "t" -NoTypeInformation

For enterprise environments with SQL Server, you can push performance data directly:

-- First create a linked server to PerfMon
EXEC sp_addlinkedserver 
    @server = 'PERFMON',
    @srvproduct = 'PerfMon',
    @provider = 'SQLNCLI',
    @datasrc = 'localhost'

-- Then query counters into a table
SELECT * INTO #TempPerfData
FROM OPENQUERY(PERFMON, 
    'SELECT * FROM CounterData')

For multi-instance counters or specific time ranges, add these parameters to relog.exe:

rem Extract only Processor(_Total) counters from 9AM to 5PM
relog input.blg -f csv -o output.csv -b "09:00" -e "17:00" -c "\Processor(_Total)\% Processor Time"

Remember that text files can grow large - consider compressing output or splitting by time periods if dealing with extended monitoring sessions.