Dear Ajani,
Once again, thank you very much for your support..
This code solves the issue with empty spaces..but now I am facing another issue..
If you see the result bellow, I get several elements combined in one:
cs5 under the Action (act),
cs2 under DestHost(dhost),
rt and externalId under DeviceCustomDate1
cs1 under ReasonCode (reason)
cs6, cn1,devicefacility, suid, duid under ResultAction (outcome)
sproc under SessionName (cs4)
sourceDnsDomain under SourceIP (src)
shost under SourceUser (suser)
I tried to add one by one some of these data elements separately, for example, right after act, I add cs5, and in <order> I have added Terminal (as cs5 is labeled as Terminal)
.... act=\s*(.*?)\s+cs5=\s*(.*?)\s+ ......
but then, I only get the name decoded..
name: 'XMA'
I am not sure where I do wrong..
If you can help me add the additional fields that are not already defined, so that all fields get decoded (the fact that some of these fields can be empty remains):
sproc= \DON.$X82V
-> SourceProcessName
sourceDnsDomain=
-> SourceDNS
cs2= $B7.SAFE
-> ProductLocation
rt= 2026-01-02 13:42:23.260437
-> ReceiveTime
externalId= 000000002
-> ExternalId
cs6= N / N
-> Test/Warn
cn1= A
-> Alerted
deviceFacility= SAFEGUARD
-> DeviceFacility
suid= 300 , 355
-> SourceUserId
duid= 355 , 355
-> DestUserId
shost= \DON
-> SourceHostName
cs5= \DON.$ZPTX3.#ZWN9597
-> Terminal
cs1=
-> RuleName
This is the last code from you, slighly changed in the names:
<decoder name="XMA">
<prematch>CEF:0</prematch>
</decoder>
<decoder name="XMA-B24">
<parent>XMA</parent>
<regex type="pcre2">^CEF:0\|([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)\|(\d+)\|.*?cs3=\s*(.*?)\s+start=\s*(.*?)\s+end=\s*(.*?)\s+cs4=\s*(.*?)\s+spid=\s*(.*?)\s+filePath=\s*(.*?)\s+src=\s*(.*?)\s+dst=\s*(.*?)\s+dhost=\s*(.*?)\s+deviceCustomDate1=\s*(.*?)\s+outcome=\s*(.*?)\s+suser=\s*(.*?)\s+duser=\s*(.*?)\s+fileType=\s*(.*?)\s+fname=\s*(.*?)\s+act=\s*(.*?)\s+cat=\s*(.*?)\s+reason=\s*(.*?)\s+msg=\s*(.+?)(?=\s+\w+Label=|$)</regex>
<order>Vendor,Product,Version,DeviceEventClassID,EventName,Severity,SessionId,start,end,SessionName,SourceProcessID,FilePath,SourceIP,DestIP,DestHost,DeviceCustomDate1,ResultAction,SourceUser,DestUser,FileType,FileName,Action,EventCategory,ReasonCode,EventMessage</order>
</decoder>
The log
CEF:0|XYPRO|NONSTOP|XMA|SOFTWARE-NORM-MSGS|SAFEGUARD-NORMAL-MESSAGES|2|cs3= FFFF02F2FF5A35F858F9 start= N end= N cs4= sproc= \DON.$X82V spid= filePath= \DON.$SYSTEM.JON02.TACL src= 11.22.33.44 sourceDnsDomain= dst= 11.22.33.44 dhost= \DON cs2= $B7.SAFE deviceCustomDate1= 2026-01-02 12:42:23.260437 rt= 2026-01-02 13:42:23.260437 externalId= 000000002 outcome= 1 cs6= N / N cn1= A deviceFacility= SAFEGUARD suid= 300 , 355 duid= 355 , 355 suser= pmJohn shost= \DON duser= SuperJohn fileType= ALIAS fname= SuperJohn 255.255 act= VERIFYUSER cs5= \DON.$ZPTX3.#ZWN9597 cat= 54 reason= 400 cs1= msg= Last Logon Time 2026-01-01 09:07:40.343101 to 2026-01-02 13:42:23.238433 cn1Label=ALERTEDcs1Label=Rulenamecs2Label=ProductLocationcs3Label=SessionIDcs4Label=SessionNamecs5Label=Terminalcs6Label=Test/Warn
The result
**Phase 1: Completed pre-decoding.
full event: 'CEF:0|XYPRO|NONSTOP|XMA|SOFTWARE-NORM-MSGS|SAFEGUARD-NORMAL-MESSAGES|2|cs3= FFFF02F2FF5A35F858F9 start= N end= N cs4= sproc= \DON.$X82V spid= filePath= \DON.$SYSTEM.JON02.TACL src= 11.22.33.44 sourceDnsDomain= dst= 11.22.33.44 dhost= \DON cs2= $B7.SAFE deviceCustomDate1= 2026-01-02 12:42:23.260437 rt= 2026-01-02 13:42:23.260437 externalId= 000000002 outcome= 1 cs6= N / N cn1= A deviceFacility= SAFEGUARD suid= 300 , 355 duid= 355 , 355 suser= pmJohn shost= \DON duser= SuperJohn fileType= ALIAS fname= SuperJohn 255.255 act= VERIFYUSER cs5= \DON.$ZPTX3.#ZWN9597 cat= 54 reason= 400 cs1= msg= Last Logon Time 2026-01-01 09:07:40.343101 to 2026-01-02 13:42:23.238433 cn1Label=ALERTEDcs1Label=Rulenamecs2Label=ProductLocationcs3Label=SessionIDcs4Label=SessionNamecs5Label=Terminalcs6Label=Test/Warn'
**Phase 2: Completed decoding.
name: 'XMA'
Action: 'VERIFYUSER cs5= \DON.$ZPTX3.#ZWN9597'
DestHost: '\DON cs2= $B7.SAFE'
DestIP: '11.22.33.44'
DestUser: 'SuperJohn'
DeviceCustomDate1: '2026-01-02 12:42:23.260437 rt= 2026-01-02 13:42:23.260437 externalId= 000000002'
DeviceEventClassID: 'SOFTWARE-NORM-MSGS'
EventCategory: '54'
EventMessage: 'Last Logon Time 2026-01-01 09:07:40.343101 to 2026-01-02 13:42:23.238433'
EventName: 'SAFEGUARD-NORMAL-MESSAGES'
FileName: 'SuperJohn 255.255'
FilePath: '\DON.$SYSTEM.JON02.TACL'
FileType: 'ALIAS'
Product: 'NONSTOP'
ReasonCode: '400 cs1='
ResultAction: '1 cs6= N / N cn1= A deviceFacility= SAFEGUARD suid= 300 , 355 duid= 355 , 355'
SessionId: 'FFFF02F2FF5A35F858F9'
SessionName: 'sproc= \DON.$X82V'
Severity: '2'
SourceIP: '11.22.33.44 sourceDnsDomain='
SourceUser: 'pmJohn shost= \DON'
Vendor: 'XYPRO'
Version: 'XMA'
end: 'N'
start: 'N'