grippo 0.2.1

Parse, match and scrub data faster and more efficiently.
Documentation
1
2
3
4
5
6
7
8
9
10
11
# Junos SRX RT_FLOW syslog messages: session create, close and deny.
RT_FLOW_EVENT (?:RT_FLOW_SESSION_CREATE|RT_FLOW_SESSION_CLOSE|RT_FLOW_SESSION_DENY)

# Close: `session closed <reason>: src/port->dst/port service nat-src/port->nat-dst/port src-rule dst-rule proto policy from-zone to-zone session-id packets(bytes) packets(bytes) elapsed ...`. The reason holds no colon. The two counts are in parentheses.
RT_FLOW1 %{RT_FLOW_EVENT:event}: %{DATA:close-reason}: %{IP:src-ip}/%{INT:src-port}->%{IP:dst-ip}/%{INT:dst-port} %{NOTSPACE:service} %{IP:nat-src-ip}/%{INT:nat-src-port}->%{IP:nat-dst-ip}/%{INT:nat-dst-port} %{NOTSPACE:src-nat-rule-name} %{NOTSPACE:dst-nat-rule-name} %{INT:protocol-id} %{NOTSPACE:policy-name} %{NOTSPACE:from-zone} %{NOTSPACE:to-zone} %{INT:session-id} [0-9]+\(%{INT:sent}\) [0-9]+\(%{INT:received}\) %{INT:elapsed-time} .*

# Create: the same through the session id, then the rest of the line.
RT_FLOW2 %{RT_FLOW_EVENT:event}: session created %{IP:src-ip}/%{INT:src-port}->%{IP:dst-ip}/%{INT:dst-port} %{NOTSPACE:service} %{IP:nat-src-ip}/%{INT:nat-src-port}->%{IP:nat-dst-ip}/%{INT:nat-dst-port} %{NOTSPACE:src-nat-rule-name} %{NOTSPACE:dst-nat-rule-name} %{INT:protocol-id} %{NOTSPACE:policy-name} %{NOTSPACE:from-zone} %{NOTSPACE:to-zone} %{INT:session-id} .*

# Deny: no NAT fields, and the protocol id is followed by the ICMP type in parentheses.
RT_FLOW3 %{RT_FLOW_EVENT:event}: session denied %{IP:src-ip}/%{INT:src-port}->%{IP:dst-ip}/%{INT:dst-port} %{NOTSPACE:service} %{INT:protocol-id}\([0-9]+\) %{NOTSPACE:policy-name} %{NOTSPACE:from-zone} %{NOTSPACE:to-zone} .*