Here is the example of CEF Data on a single column named raw
{
"raw": "CEF:0|Check Point|New Anti Virus|Check Point|DNS reputation
|Malware.TC.d8ccLeiq|Low|act=Detect cp_severity=Low
cs1Label=Threat Prevention Rule Name cs1=Autonomous Threat Prevention
cs2Label=Protection ID cs2=000DC8CC6 cs3Label=Protection Type
cs3=DNS reputation cs4Label=Protection Name cs4=Malware.TC.d8ccLeiq
cs4Label=Threat Prevention Rule ID cs4={678d033c-df1b-4a63-9ee0-11c6dd0dd028} cs6Label=Malware Family
cs6=Malware deviceDirection=1 flexNumber1Label=Confidence flexNumber1=1 flexString2Label=Malware
Action flexString2=DNS query for a site known to contain malware request=killz.pro
rt=1677624210000 sourceTranslatedAddress=30.20.0.5 spt=56476 dpt=53
cs4Label=Threat Prevention Rule ID cs4={678d033c-df1b-4a63-9ee0-11c6dd0dd028}
cs1Label=Threat Prevention Rule Name cs1=Autonomous Threat Prevention layer_name=Standard Threat Prevention
layer_uuid={D3A3D454-5CCB-4615-BA16-9CD7AFB4D084} smartdefense_profile=Strict Security
ifname=eth1 loguid={0x194377b3,0x558f5b34,0x692cf8a8,0x2f1636c7}
origin=30.20.0.10 originsicname=cn\\=cp_mgmt,o\\=checkpointfw..2nndov sequencenum=2
version=5 dst=1.1.1.1 log_id=2 policy=Standard
policy_time=1677624104 product=New Anti Virus proto=17
session_id={0x63fe8392,0x1,0x9381505b,0xddd7167c} smartdefense_profile=Strict Security
src=30.20.0.5 vendor_list=Check Point ThreatCloud"
}
I have been trying to filter the origin=30.20.0.10 and dst=1.1.1.1 and put them on a separate column. named origin_ip and dest_ip.
I have tried to nest that as separate table but it doesn't seem to work for me.(or not sure if I am doing it correctly) I am not sure how to do it with Regex and I cannot find any online reference in filtering CEF logs using SQL.
Appreciate any idea here.