Skip to content

Commit 729f2cd

Browse files
fix: Added a couple of parsers in the enterprise version. (#2734)
1 parent f3c103c commit 729f2cd

File tree

2 files changed

+127
-3
lines changed

2 files changed

+127
-3
lines changed

package/enterprise/etc/conf.d/conflib/netsource/app-netsource-netapp_ontap.conf

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ block parser app-netsource-netapp_ontap() {
3434
class('audit')
3535
);
3636
};
37+
} elif {
38+
parser {
39+
regexp-parser(
40+
prefix(".tmp.")
41+
patterns('\[(?<host>[^:]+):(?<category>[^:]+):(?<severity>[^\]]+)\]: (?<message>.*)')
42+
template("${MESSAGE}")
43+
);
44+
};
45+
rewrite {
46+
set('${.tmp.message}' value('MESSAGE'));
47+
set('${.tmp.host}' value('HOST'));
48+
set('${.tmp.category}' value('fields.category'));
49+
set('${.tmp.severity}' value('fields.severity'));
50+
};
51+
rewrite {
52+
r_set_splunk_dest_update_v2(
53+
sourcetype('netapp:ontap:ems')
54+
class('ems')
55+
);
56+
};
3757
} else {
3858
rewrite {
3959
r_set_splunk_dest_update_v2(
@@ -46,10 +66,10 @@ block parser app-netsource-netapp_ontap() {
4666
};
4767

4868
application app-netsource-netapp_ontap[sc4s-network-source] {
49-
filter {
69+
filter {
5070
match("netapp", value('.netsource.sc4s_vendor'), type(string))
5171
and match("ontap", value('.netsource.sc4s_product'), type(string))
5272
and "`SC4S_NETAPP_ONTAP_NEW_FORMAT`" eq "yes"
53-
};
73+
};
5474
parser { app-netsource-netapp_ontap(); };
55-
};
75+
};
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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

Comments
 (0)