1+ block parser app-syslog-vectra-json() {
2+ channel {
3+ parser {
4+ regexp-parser(
5+ prefix(".tmp.")
6+ patterns('\"vectra_timestamp\"\:\s\"(?<timestamp>[^\"]+)\"')
7+ template("$MESSAGE")
8+ );
9+ date-parser-nofilter(
10+ format('%s')
11+ template("${.tmp.timestamp}")
12+ );
13+ };
14+
15+ rewrite {
16+ subst('\-\:\s',"",value("MESSAGE"));
17+ };
18+
19+ rewrite {
20+ r_set_splunk_dest_default(
21+ index("main")
22+ sourcetype('vectra:cognito:detect:json')
23+ vendor("vectra")
24+ product("cognito detect")
25+ class('detect')
26+ template("t_msg_only")
27+ );
28+ };
29+
30+ if (message('\"host_\w+\"\:')) {
31+ rewrite {
32+ r_set_splunk_dest_update_v2(
33+ sourcetype('vectra:cognito:hostscoring:json')
34+ class('hostscoring')
35+ condition(message('\"HOST\sSCORING\"'))
36+ );
37+ };
38+ rewrite {
39+ r_set_splunk_dest_update_v2(
40+ sourcetype('vectra:cognito:hostdetect:json')
41+ class('hostdetect')
42+ condition(message('\"detection_id\"\:'))
43+ );
44+ };
45+ rewrite {
46+ r_set_splunk_dest_update_v2(
47+ sourcetype('vectra:cognito:hostlockdown:json')
48+ class('hostlockdown')
49+ condition(message('\"success\"\:'))
50+ );
51+ };
52+ } elif (message('\"account_uid\"\:')) {
53+ rewrite {
54+ r_set_splunk_dest_update_v2(
55+ sourcetype('vectra:cognito:accountscoring:json')
56+ class('accountscoring')
57+ condition(message('\"ACCOUNT\sSCORING\"'))
58+ );
59+ };
60+ rewrite {
61+ r_set_splunk_dest_update_v2(
62+ sourcetype('vectra:cognito:accountdetect:json')
63+ class('accountdetect')
64+ condition(message('\"detection_id\"\:'))
65+ );
66+ };
67+ rewrite {
68+ r_set_splunk_dest_update_v2(
69+ sourcetype('vectra:cognito:accountlockdown:json')
70+ class('accountlockdown')
71+ condition(message('\"success\"\:'))
72+ );
73+ };
74+ } elif (message('\"campaign_id\"\:')) {
75+ rewrite {
76+ r_set_splunk_dest_update_v2(
77+ sourcetype('vectra:cognito:campaigns:json')
78+ class('campaigns')
79+ );
80+ };
81+ } elif (message('\"role\"\:')) {
82+ rewrite {
83+ r_set_splunk_dest_update_v2(
84+ sourcetype('vectra:cognito:audit:json')
85+ class('audit')
86+ );
87+ };
88+ } elif (message('\"type\"\:')) {
89+ rewrite {
90+ r_set_splunk_dest_update_v2(
91+ sourcetype('vectra:cognito:health:json')
92+ class('health')
93+ );
94+ };
95+ } else {};
96+ };
97+ };
98+
99+ application app-syslog-vectra-json[sc4s-syslog-pgm] {
100+ filter {
101+ program('vectra_json' type(string) flags(prefix));
102+ };
103+ parser { app-syslog-vectra-json(); };
104+ };
0 commit comments