Skip to content

Commit

Permalink
Updated test cases and log path file
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaleiya committed May 13, 2020
1 parent d29bd31 commit 50a1dfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions package/etc/conf.d/log_paths/lp-cisco_wsa.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ log{
} elif {
filter(f_cisco_wsa11_7);
parser {
channel {
filter {
program(
'(?:(?<EPOCH>\d{10})(?:.(?<TIMESECFRAC>\d{1,9}))?)'
Expand All @@ -46,6 +47,7 @@ log{
template("${EPOCH}.${TIMESECFRAC}")
);
};
};
};
rewrite {
set("cisco_wsa11_7", value("fields.sc4s_vendor_product"));
Expand All @@ -57,6 +59,7 @@ log{

} else {
parser {
channel {
filter {
program(
'(?:(?<EPOCH>\d{10})(?:.(?<TIMESECFRAC>\d{1,9}))?)'
Expand All @@ -68,6 +71,7 @@ log{
template("${EPOCH}.${TIMESECFRAC}")
);
};
};
};
rewrite {
set("cisco_wsa", value("fields.sc4s_vendor_product"));
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cisco_wsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_cisco_wsa_squid_11_7(record_property, setup_wordlist, get_host_key, set
sendsingle(message, setup_sc4s[0], setup_sc4s[1][514])

st = env.from_string(
"search index=netops _time={{ epoch }} sourcetype=\"cisco:wsa:squid:new\" _raw=\"{{ message }}\"")
"search index=netops sourcetype=\"cisco:wsa:squid:new\" _raw=\"{{ message }}\"")
message1 = mt.render(mark="", bsd="", host="")
search = st.render(epoch=epoch ,host=host, message=message1.lstrip().replace('"','\\"'))
resultCount, eventCount = splunk_single(setup_splunk, search)
Expand All @@ -78,7 +78,7 @@ def test_cisco_wsa_squid(record_property, setup_wordlist, get_host_key, setup_sp
sendsingle(message, setup_sc4s[0], setup_sc4s[1][514])

st = env.from_string(
"search index=netops _time={{ epoch }} sourcetype=\"cisco:wsa:squid\" _raw=\"{{ message }}\"")
"search index=netops sourcetype=\"cisco:wsa:squid\" _raw=\"{{ message }}\"")
message1 = mt.render(mark="", bsd="", host="")
search = st.render(epoch=epoch ,host=host, message=message1.lstrip().replace('"','\\"'))
resultCount, eventCount = splunk_single(setup_splunk, search)
Expand Down

0 comments on commit 50a1dfb

Please sign in to comment.