FortiSIEM Custom JSON Parser
Hi all. I'm having issues with this JSON custom parser. I'm trying to test it but I receive an error without any details or parser used. I tried everything and I'm not sure where to go next.
Here is the parser:
<eventFormatRecognizer> <![CDATA[\[PH_DEV_MON_CUSTOM_JSON\]:\[reptVendor\]=jamf]]> </eventFormatRecognizer> <patternDefinitions> <pattern name="patLazyNestedJSON"> <![CDATA[({[\s\S]*?})]]> </pattern> <pattern name="patGreedyNestedJSON"> <![CDATA[({[\s\S]*})]]> </pattern> <pattern name="patEventType"> <![CDATA[\w+]]> </pattern> </patternDefinitions> <parsingInstructions> <!-- Get the raw message and json data objects --> <collectFieldsByRegex src="$_rawmsg"> <regex> <![CDATA[\[PH_DEV_MON_CUSTOM_JSON\]:<_body:gPatMesgBodyMin>,\[json\]=<_json:gPatMesgBodyMin>\s*$]]> </regex> </collectFieldsByRegex> <!-- parse out nested json objects --> <collectFieldsByRegex src="$_json"> <regex> <![CDATA["webhook":\s+<_webhook:patLazyNestedJSON>,\s+"event"]]> </regex> </collectFieldsByRegex> <collectFieldsByRegex src="$_json"> <regex> <![CDATA["event":\s+<_event:patGreedyNestedJSON>]]> </regex> </collectFieldsByRegex> <!-- Collect attributes in [] --> <collectAndSetAttrBySymbol sep=",[" src="$_body" symEnd="]=" symStart="["/> <setEventAttribute attr="eventType">"JAMF-CLOUD-JSON"</setEventAttribute> <collectAndSetAttrByJSON src="$_webhook"> <attrKeyMap attr="devName" key="name"/> </collectAndSetAttrByJSON> </parsingInstructions>
And here is the raw JSON file
[PH_DEV_MON_CUSTOM_JSON]:[reptVendor]=jamf,[reptModel]=Cloud,[reptDevName]=jamf,[reptDevIpAddr]=10.47.7.9,[json]={ { "webhook": { "id": 2, "name": "SIEM", "webhookEvent": "ComputerPolicyFinished", "eventTimestamp": 1628873569515 }, "event": { "policyId": 219, "successful": true, "computer": { "udid": "20FF5074-46DE-58D3-9702-546ADA164942", "deviceName": "FVFXV1TWHV2F", "model": "13-inch Retina MacBook Pro (Mid 2017)", "macAddress": "38:F9:D3:4D:52:AC", "alternateMacAddress": "46:00:B8:80:13:01", "serialNumber": "FVFXV1TWHV2F", "osVersion": "10.14.6", "osBuild": "18G8022", "userDirectoryID": "-1", "username": "jsmith", "realName": "John Smith", "emailAddress": "test@test.com", "phone": "", "position": "Sales Analyst", "department": "Sales", "building": "New York", "room": "", "ipAddress": "100.50.100.200", "reportedIpAddress": "192.168.1.158", "jssID": 989 } }, "event_type": "ComputerPolicyFinished" }
Note that when I test it I make sure to use a single line JSON.
Thanks for all the help and have a nice day
