Workflow Tools Control Yard

Home / Logs

Windows Firewall log reader

Open or paste a Windows Firewall log, such as pfirewall.log: its lines become a table, and the dropped packets are counted by port and by address. Below, the commands that turn the log on. The log is read in your browser and goes nowhere else.

The fields of the log

The log is text: a few header lines that start with #, then one line per entry with its fields separated by spaces, and - where a field has no value. The #Fields: line names the fields in their order, and the page reads the lines by it. #Time Format: Local says that dates and times are local time. The fields as Microsoft's article for Windows Server 2003 describes them; if the #Fields line of your log names others, the page shows those too:

FieldWhat it holds
dateThe day of the entry, as YYYY-MM-DD.
timeThe time of the entry, as HH:MM:SS on a 24-hour clock. Both are in the local time of the computer that wrote the log.
actionWhat the firewall did. The 2003 article lists OPEN, OPEN-INBOUND, CLOSE, DROP and INFO-EVENTS-LOST; the page counts whatever words your log has.
protocolTCP, UDP, ICMP, or the protocol number of other packets.
src-ipThe address of the computer that started the communication.
dst-ipThe address it was sent to.
src-portThe source port; TCP and UDP only, otherwise -.
dst-portThe destination port; TCP and UDP only, otherwise -.
sizeThe size of the packet in bytes.
tcpflagsThe TCP flags of the packet: A (ACK), F (FIN), P (PSH), R (RST), S (SYN), U (URG).
tcpsynThe TCP sequence number.
tcpackThe TCP acknowledgement number.
tcpwinThe TCP window size in bytes.
icmptypeThe ICMP type.
icmpcodeThe ICMP code.
infoDepends on the action: for INFO-EVENTS-LOST, how many events were not written since the last such entry.
pathThe direction: SEND, RECEIVE, FORWARD or UNKNOWN.

Turning the log on

Each firewall profile (Domain, Private, Public) has its own log settings. By default nothing is logged, the file is %windir%\system32\logfiles\firewall\pfirewall.log and the limit is 4,096 KB. Microsoft's logging page recommends at least 20,480 KB and a file per profile, and turns on both dropped packets and successful connections. The limit can be 1 to 32,767 KB; past it, the oldest entries are overwritten.

Profiles
Log

PowerShell, as an administrator

Command prompt, as an administrator

A folder other than the default has to exist, and the firewall service has to be able to write to it: give NT SERVICE\mpssvc write access. Get-NetFirewallProfile -PolicyStore ActiveStore shows the settings in effect (without -PolicyStore it shows the stored ones), and netsh advfirewall show allprofiles logging shows the logging settings.

Sources

More Logs tools