-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #1299
- Loading branch information
rfaircloth-splunk
committed
Oct 20, 2021
1 parent
bb708fe
commit 53b98e3
Showing
7 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Vendor - Raritan | ||
|
||
|
||
## Product - DSX | ||
|
||
|
||
| Ref | Link | | ||
|----------------|---------------------------------------------------------------------------------------------------------| | ||
| Splunk Add-on | none | | ||
| Product Manual | https://www.raritan.com/products/kvm-serial/serial-console-servers/serial-over-ip-console-server | | ||
|
||
|
||
### Sourcetypes | ||
|
||
| sourcetype | notes | | ||
|----------------|---------------------------------------------------------------------------------------------------------| | ||
| raritan:dsx | Note events do not contain host | | ||
|
||
### Sourcetype and Index Configuration | ||
|
||
| key | sourcetype | index | notes | | ||
|----------------|----------------|----------------|----------------| | ||
| raritan_dsx | raritan:dsx | infraops | none | | ||
|
||
### Filter type | ||
|
||
Requires port or vendor product by source config | ||
|
||
### Setup and Configuration | ||
|
||
unknown | ||
|
||
### Options | ||
|
||
| Variable | default | description | | ||
|----------------|----------------|----------------| | ||
| SC4S_LISTEN_RARITAN_DSX_TCP_PORT | empty string | Enable a TCP port for this specific vendor product using a comma-separated list of port numbers | | ||
| SC4S_LISTEN_RARITAN_DSX_UDP_PORT | empty string | Enable a UDP port for this specific vendor product using a comma-separated list of port numbers | | ||
| SC4S_ARCHIVE_RARITAN_DSX | no | Enable archive to disk for this specific source | | ||
| SC4S_DEST_RARITAN_DSX_HEC | no | When Splunk HEC is disabled globally set to yes to enable this specific source | | ||
|
||
### Verification | ||
|
||
An active proxy will generate frequent events. Use the following search to validate events are present per source device | ||
|
||
``` | ||
index=<asconfigured> sourcetype=raritan:dsx | stats count by host | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
package/etc/conf.d/conflib/net_source/app-raritan_dsx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
block parser raritan_dsx-parser() { | ||
channel { | ||
rewrite { | ||
r_set_splunk_dest_default( | ||
index('infraops') | ||
sourcetype('raritan:dsx') | ||
vendor_product("raritan_dsx") | ||
template('t_hdr_msg') | ||
); | ||
}; | ||
}; | ||
}; | ||
application raritan_dsx[sc4s-network-source] { | ||
filter { | ||
"${.netsource.sc4s_vendor_product}" eq "raritan_dsx" | ||
or "${SOURCE}" eq "s_RARITAN_DSX" | ||
}; | ||
parser { raritan_dsx-parser(); }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2019 Splunk, Inc. | ||
# | ||
# Use of this source code is governed by a BSD-2-clause-style | ||
# license that can be found in the LICENSE-BSD2 file or at | ||
# https://opensource.org/licenses/BSD-2-Clause | ||
import random | ||
|
||
from jinja2 import Environment | ||
|
||
from .sendmessage import * | ||
from .splunkutils import * | ||
from .timeutils import * | ||
|
||
env = Environment() | ||
|
||
# <110>M_00796: User radware Session with client radware was terminated due to Inactivity. | ||
def test_raritan_dsx(record_property, setup_wordlist, setup_splunk, setup_sc4s): | ||
host = "{}-{}".format(random.choice(setup_wordlist), random.choice(setup_wordlist)) | ||
|
||
dt = datetime.datetime.now() | ||
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt) | ||
|
||
# Tune time functions | ||
epoch = epoch[:-7] | ||
|
||
mt = env.from_string( | ||
"{{mark}}[Login Failed]: Authentication failed for user 'cartertest' from host '{{ key }}'\n" | ||
) | ||
message = mt.render(mark="<27>", key=host) | ||
sendsingle(message, setup_sc4s[0], setup_sc4s[1][9001]) | ||
|
||
st = env.from_string('search index=infraops sourcetype=raritan:dsx "{{key}}"') | ||
search = st.render(epoch=epoch, key=host) | ||
|
||
resultCount, eventCount = splunk_single(setup_splunk, search) | ||
|
||
record_property("host", host) | ||
record_property("resultCount", resultCount) | ||
record_property("message", message) | ||
|
||
assert resultCount == 1 |