using System.Text.RegularExpressions;
public static void Main()
________________________________
From: faz@airespring.com <faz@airespring.com>
Sent: Wednesday, November 22, 2023 9:27 PM
To: fortianalyzer-alerts <fortianalyzer-alerts@airespring.com>; Josue Escalante <Josue.Escalante@airespring.com>
Subject: [External] FortiSwitch is Offline (medium switch-controller alert FortiSwitch is Offline 1385583_Airespring_COGS_MSE_LAB1(FortiGate-40F))
Device 1385583_Airespring_COGS_MSE_LAB1
From USLA-FAZ01P(FAZ-VMTM20010246)
Trigger Forti Switch - DOWN
logver 0700120523 idseq 199977991999062695
Time Stamp 2023-11-22 13:27:36 Device ID FGT40FTK2209G99N
Device Name FortiGate-40F Virtual Domain root
Date 2023-11-22 Time 13:27:06
eventtime 1700688426686115790 Time Zone -0800
Log ID 0115022904 Type event
Sub Type switch-controller Level notice
Log Description CAPUTP session status notification User Switch-Controller
User Interface cu_acd SN S124FFTF23020941
Name S124FFTF23020941 Message S124FFTF23020941 echo message timed out
Action session-leave Source IP 10.255.1.2
string deviceIdPattern = @"Device ID\s+(\S+)";
Match deviceIdMatch = Regex.Match(input, deviceIdPattern);
if (deviceIdMatch.Success)
string deviceId = deviceIdMatch.Groups[1].Value;
Console.WriteLine("Device ID: " + deviceId);
Console.WriteLine("Device ID not found.");
string deviceNumberPattern = @"Device\s+(\d+)_";
Match deviceNumberMatch = Regex.Match(input, deviceNumberPattern);
if (deviceNumberMatch.Success)
string customerNumber = deviceNumberMatch.Groups[1].Value;
Console.WriteLine("Customer Number: " + customerNumber);
Console.WriteLine("Customer Number not found.");