jerome_itable Lv2Posted 23 Jan 2024 16:45
  
You're right, Sangfor NGAF logs can have different formats depending on the source and category. Here are some sample logs for different sections to help you write regex patterns:

System > Logs:

    System information:

Apr 12 11:59:39 localhost syslog: System information: CPU usage 80%, RAM usage 60%, Disk usage 40%

    Alert events:

Jul 13 17:04:31 sangforiad-0cca syslog: Alert detected: High CPU usage on firewall, exceeding 85% threshold

    Configuration changes:

May 15 10:20:32 localhost syslog: Configuration changed: Added new firewall rule for blocking port 22

Monitoring > Logs:

    Traffic logs:

Jul 13 17:04:31 sangforiad-0cca monitor: Source IP: 192.168.1.10, Destination IP: 8.8.8.8, Protocol: TCP, Port: 443, Action: Allowed

    Resource usage:

Apr 12 12:59:39 localhost monitor: Interface eth0: Inbound traffic 100 Mbps, Outbound traffic 20 Mbps

    Session logs:

May 15 10:20:32 localhost monitor: New session established: Source IP: 172.16.3.20, Destination IP: 10.0.0.1, Protocol: UDP, Duration: 10 minutes

Security > Logs:

    Firewall events:

Jul 13 17:04:31 sangforiad-0cca security: Firewall rule triggered: Block outbound traffic to port 25 from 192.168.1.10

    Intrusion detection:

Apr 12 12:59:39 localhost security: Intrusion detected: ICMP flood attack from 172.16.2.14

    Anti-virus:

May 15 10:20:32 localhost security: Anti-virus scan detected: File "C:\Windows\System32\virus.exe" is infected with Trojan.Win32.Agent.a

These are just a few examples, and the actual format of the logs can vary depending on your Sangfor NGAF version and configuration. However, they should give you a good starting point for writing regex patterns to extract the desired fields.

Here are some additional tips for writing regex patterns:

    Use tools like Regex101 or RegexBuddy to test your patterns.
    Start with simple patterns and gradually add complexity.
    Consider using named capturing groups to extract specific parts of the log message.
    Be aware of edge cases and potential variations in the log format.

I Can Help:

Change

Moderator on This Board

0
2
4

Started Topics

Followers

Follow

67
14
3

Started Topics

Followers

Follow

3
0
2

Started Topics

Followers

Follow

1
131
3

Started Topics

Followers

Follow

Board Leaders