Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netapp ontap audit ems support #2639

Merged
merged 14 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated the code to maintain the backward compatibility
  • Loading branch information
cwadhwani-splunk committed Nov 14, 2024
commit affa813923ec1684b1e9bc61a6632ed40f990e4e
6 changes: 4 additions & 2 deletions docs/sources/vendor/NetApp/ontap.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

| sourcetype | notes |
|----------------|---------------------------------------------------------------------------------------------------------|
| netapp:ontap:audit | None |
| netapp:ontap:ems | None |
| ontap:ems | This sourcetype will be assinged only when the environment variable `SC4S_NETAPP_ONTAP_NEW_FORMAT` is not set or is set to 'no'. By default it is unset |
| netapp:ontap:audit | This sourcetype will be assinged only when the environment variable `SC4S_NETAPP_ONTAP_NEW_FORMAT` is set to 'yes' |
| netapp:ontap:ems | This sourcetype will be assinged only when the environment variable `SC4S_NETAPP_ONTAP_NEW_FORMAT` is set to 'yes' |

## Sourcetype and Index Configuration

| key | sourcetype | index | notes |
|----------------|----------------|----------------|----------------|
| netapp_ontap | ontap:ems | infraops | none |
| netapp_ontap_audit | netapp:ontap:audit | infraops | none |
| netapp_ontap_ems | netapp:ontap:ems | infraops | none |

Expand Down
2 changes: 1 addition & 1 deletion docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For a step by step guide [see here](./v3_upgrade.md).
You may need to migrate legacy log paths or version 1 app-parsers for version 2. To do this, open an issue and attach the original configuration and a compressed pcap of sample data for testing. We will evaluate whether to include the source in an upcoming release.

### Upgrade from <3.33.0
In NetApp ONTAP, the ontap:ems sourcetype has been updated to netapp:ontap:audit, so old logs are now classified under netapp:ontap:audit. Additionally, a new netapp:ontap:ems sourcetype has been introduced. If you upgrade, ensure that you configure your system to send the logs to a specific port or have a hostname-based configuration in place for proper log onboarding into Splunk.
In NetApp ONTAP, the ontap:ems sourcetype has been updated to netapp:ontap:audit, so old logs are now classified under netapp:ontap:audit. Additionally, a new netapp:ontap:ems sourcetype has been introduced. If you upgrade and want these new changes, ensure that you set `SC4S_NETAPP_ONTAP_NEW_FORMAT` environment variable to `yes` and configure your system to send the logs to a specific port or have a hostname-based configuration in place for proper log onboarding into Splunk.

### Upgrade from <2.23.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ block parser app-netsource-netapp_ontap() {
class('audit')
);
};
} elif {
filter(f_is_rfc5424);
rewrite {
r_set_splunk_dest_update_v2(
sourcetype('netapp:ontap:ems')
class('ems')
);
};
} else {
rewrite {
r_set_splunk_dest_update_v2(
Expand All @@ -57,6 +49,7 @@ application app-netsource-netapp_ontap[sc4s-network-source] {
filter {
match("netapp", value('.netsource.sc4s_vendor'), type(string))
and match("ontap", value('.netsource.sc4s_product'), type(string))
and "`SC4S_NETAPP_ONTAP_NEW_FORMAT`" eq "yes"
};
parser { app-netsource-netapp_ontap(); };
};
44 changes: 44 additions & 0 deletions package/etc/conf.d/conflib/syslog/app-syslog-netapp_ontap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
block parser app-syslog-netapp_ontap() {
channel {
parser {
regexp-parser(
prefix(".tmp.")
patterns('^[A-Za-z0-9\-\_\.]+: [0-9a-f]+\.[0-9a-f]+ [0-9a-f]+ [A-Z][a-z][a-z] (?<timestamp>[A-Z][a-z][a-z] \d\d \d\d\d\d \d\d:\d\d:\d\d [+-]?\d{1,2}:\d\d)')
);
date-parser-nofilter(
format(
'%a %d %Y %H:%M:%S %z',
)
template("${.tmp.timestamp}")
);
};
rewrite {
set('$PROGRAM: $MESSAGE', value(MESSAGE));
set('$PROGRAM', value(HOST));
unset(value(PROGRAM));
};

rewrite {
r_set_splunk_dest_default(
index("infraops")
sourcetype('ontap:ems')
vendor("netapp")
product("ontap")
);
};

rewrite {
r_set_splunk_dest_update_v2(
class('ems')
);
};

};
};
application app-syslog-netapp_ontap[sc4s-syslog] {
filter {
program('^[A-Za-z0-9\-\_\.]+$')
and not "`SC4S_NETAPP_ONTAP_NEW_FORMAT`" eq "yes";
};
parser { app-syslog-netapp_ontap(); };
};
55 changes: 55 additions & 0 deletions package/lite/etc/addons/netapp/app-netsource-netapp_ontap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
block parser app-netsource-netapp_ontap() {
channel {
rewrite {
r_set_splunk_dest_default(
index("infraops")
vendor("netapp")
product("ontap")
);
};

if {
parser {
regexp-parser(
prefix(".tmp.")
patterns('^[A-Za-z0-9\-\_\.]+: [0-9a-f]+\.[0-9a-f]+ [0-9a-f]+ [A-Z][a-z][a-z] (?<timestamp>[A-Z][a-z][a-z] \d\d \d\d\d\d \d\d:\d\d:\d\d [+-]?\d{1,2}:\d\d)')
);
date-parser-nofilter(
format(
'%b %d %Y %H:%M:%S %z',
)
template("${.tmp.timestamp}")
);
};

rewrite {
set('$PROGRAM: $MESSAGE', value(MESSAGE));
set('$PROGRAM', value(HOST));
unset(value(PROGRAM));
};

rewrite {
r_set_splunk_dest_update_v2(
sourcetype('netapp:ontap:audit')
class('audit')
);
};
} else {
rewrite {
r_set_splunk_dest_update_v2(
sourcetype('netapp:ontap:ems')
class('ems')
);
};
};
};
};

application app-netsource-netapp_ontap[sc4s-network-source] {
filter {
match("netapp", value('.netsource.sc4s_vendor'), type(string))
and match("ontap", value('.netsource.sc4s_product'), type(string))
and "`SC4S_NETAPP_ONTAP_NEW_FORMAT`" eq "yes"
};
parser { app-netsource-netapp_ontap(); };
};
76 changes: 29 additions & 47 deletions package/lite/etc/addons/netapp/app-syslog-netapp_ontap.conf
Original file line number Diff line number Diff line change
@@ -1,62 +1,44 @@
block parser app-netsource-netapp_ontap() {
block parser app-syslog-netapp_ontap() {
channel {
parser {
regexp-parser(
prefix(".tmp.")
patterns('^[A-Za-z0-9\-\_\.]+: [0-9a-f]+\.[0-9a-f]+ [0-9a-f]+ [A-Z][a-z][a-z] (?<timestamp>[A-Z][a-z][a-z] \d\d \d\d\d\d \d\d:\d\d:\d\d [+-]?\d{1,2}:\d\d)')
);
date-parser-nofilter(
format(
'%a %d %Y %H:%M:%S %z',
)
template("${.tmp.timestamp}")
);
};
rewrite {
set('$PROGRAM: $MESSAGE', value(MESSAGE));
set('$PROGRAM', value(HOST));
unset(value(PROGRAM));
};

rewrite {
r_set_splunk_dest_default(
index("infraops")
sourcetype('ontap:ems')
vendor("netapp")
product("ontap")
);
};

if {
parser {
regexp-parser(
prefix(".tmp.")
patterns('^[A-Za-z0-9\-\_\.]+: [0-9a-f]+\.[0-9a-f]+ [0-9a-f]+ [A-Z][a-z][a-z] (?<timestamp>[A-Z][a-z][a-z] \d\d \d\d\d\d \d\d:\d\d:\d\d [+-]?\d{1,2}:\d\d)')
);
date-parser-nofilter(
format(
'%b %d %Y %H:%M:%S %z',
)
template("${.tmp.timestamp}")
);
};

rewrite {
set('$PROGRAM: $MESSAGE', value(MESSAGE));
set('$PROGRAM', value(HOST));
unset(value(PROGRAM));
};

rewrite {
r_set_splunk_dest_update_v2(
sourcetype('netapp:ontap:audit')
class('audit')
);
};
} elif {
filter(f_is_rfc5424);
rewrite {
r_set_splunk_dest_update_v2(
sourcetype('netapp:ontap:ems')
class('ems')
);
};
} else {
rewrite {
r_set_splunk_dest_update_v2(
sourcetype('netapp:ontap:ems')
class('ems')
);
};
rewrite {
r_set_splunk_dest_update_v2(
class('ems')
);
};

};
};

application app-netsource-netapp_ontap[sc4s-network-source] {
application app-syslog-netapp_ontap[sc4s-syslog] {
filter {
match("netapp", value('.netsource.sc4s_vendor'), type(string))
and match("ontap", value('.netsource.sc4s_product'), type(string))
program('^[A-Za-z0-9\-\_\.]+$')
and not "`SC4S_NETAPP_ONTAP_NEW_FORMAT`" eq "yes";
};
parser { app-netsource-netapp_ontap(); };
parser { app-syslog-netapp_ontap(); };
};
Loading