Grok Parse Failure when dealing with IPv6 addresses

Hello all!

I’ve been slowly learning how to use the ELK stack and getting it to work with my PFsense logs and have gotten almost everything to work. Right now the only issue I have seems to be related to IPv6 addresses.

The logs that failed parsing are below.

7,16777216,,1000000105,bridge0,match,block,in,6,0x00,0x00000,1,UDP,17,99,fe80::d48f:e3dc:dbbe:c74,ff02::1:2,546,547,99

12,16777216,,1000000107,em0,match,pass,in,6,0x00,0x00000,255,ICMPv6,58,32,fe80::217:10ff:fe87:a91f,fe80::278:2aff:fee8:3554

The pattern that I am matching the log against is below.

%{PFSENSE_LOG_DATA}%{PFSENSE_IP_SPECIFIC_DATA}%{PFSENSE_IP_DATA}%{PFSENSE_PROTOCOL_DATA}

Doing some testing and changes on https://grokdebug.herokuapp.com/ let me narrow down the issue to the last bit (%{PFSENSE_PROTOCOL_DATA}). I’ve provided the pattern for that section below.

PFSENSE_PROTOCOL_DATA (%{PFSENSE_TCP_DATA}|%{PFSENSE_UDP_DATA}|%{PFSENSE_ICMP_DATA}|%{PFSENSE_CARP_DATA})

PFSENSE_TCP_DATA (%{INT:src_port}),(%{INT:dest_port}),(%{INT:data_length}),(%{WORD:tcp_flags}),(%{INT:sequence_number}),(%{INT:ack_number}),(%{INT:tcp_window}),(%{DATA:urg_data}),(%{DATA:tcp_options})

PFSENSE_UDP_DATA (%{INT:src_port}),(%{INT:dest_port}),(%{INT:data_length})

PFSENSE_ICMP_DATA (%{PFSENSE_ICMP_TYPE}%{PFSENSE_ICMP_RESPONSE})

PFSENSE_ICMP_TYPE (?<icmp_type>(request|reply|unreachproto|unreachport|unreach|timeexceed|paramprob|redirect|maskreply|needfrag|tstamp|tstampreply)),

PFSENSE_ICMP_RESPONSE (%{PFSENSE_ICMP_ECHO_REQ_REPLY}|%{PFSENSE_ICMP_UNREACHPORT}| %{PFSENSE_ICMP_UNREACHPROTO}|%{PFSENSE_ICMP_UNREACHABLE}|%{PFSENSE_ICMP_NEED_FLAG}|%{PFSENSE_ICMP_TSTAMP}|%{PFSENSE_ICMP_TSTAMP_REPLY})

PFSENSE_ICMP_ECHO_REQ_REPLY (%{INT:icmp_echo_id}),(%{INT:icmp_echo_sequence})

PFSENSE_ICMP_UNREACHPORT (%{IP:icmp_unreachport_dest_ip}),(%{WORD:icmp_unreachport_protocol}),(%{INT:icmp_unreachport_port})

PFSENSE_ICMP_UNREACHPROTO (%{IP:icmp_unreach_dest_ip}),(%{WORD:icmp_unreachproto_protocol})

PFSENSE_ICMP_UNREACHABLE (%{GREEDYDATA:icmp_unreachable})

PFSENSE_ICMP_NEED_FLAG (%{IP:icmp_need_flag_ip}),(%{INT:icmp_need_flag_mtu})

PFSENSE_ICMP_TSTAMP (%{INT:icmp_tstamp_id}),(%{INT:icmp_tstamp_sequence})

PFSENSE_ICMP_TSTAMP_REPLY (%{INT:icmp_tstamp_reply_id}),(%{INT:icmp_tstamp_reply_sequence}),(%{INT:icmp_tstamp_reply_otime}),(%{INT:icmp_tstamp_reply_rtime}),(%{INT:icmp_tstamp_reply_ttime})

PFSENSE_CARP_DATA (%{WORD:carp_type}),(%{INT:carp_ttl}),(%{INT:carp_vhid}),(%{INT:carp_version}),(%{INT:carp_advbase}),(%{INT:carp_advskew})

I am currently using the latest versions of the ELK stack and PFSense.

I want to believe it has something to do with the syntax of the custom pattern regarding IPv6 addresses but I am not that familiar with the IPv6 syntax so not sure if I am looking at the wrong area or not.

Any guidance would be appreciated.

Anyone have any advice on this?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.