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

New Template for Cisco IOS Log Messages #554

Merged
merged 12 commits into from
Dec 11, 2019
15 changes: 15 additions & 0 deletions templates/cisco_ios_show_logging.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Value NUMBER (\d+)
Value MONTH (\w+)
Value DAY (\d+)
Value TIME ((\d+:\d+:\d+\.\d+)|(\d+:\d+:\d+))
Value TIMEZONE (\w+)
Value FACILITY (.*)
Value SEVERITY (\d)
Value MNEMONIC (\w+)
Value MESSAGE (.*)

Start
^${NUMBER}[:]\s${MONTH}\s+${DAY}\s+${TIME}:\s*%${FACILITY}-${SEVERITY}-${MNEMONIC}:\s${MESSAGE} -> Record
^${NUMBER}[:]\s${MONTH}\s+${DAY}\s+${TIME}\s*${TIMEZONE}:\s%${FACILITY}-${SEVERITY}-${MNEMONIC}:\s${MESSAGE} -> Record
^${MONTH}\s+${DAY}\s+${TIME}\s*:\s%${FACILITY}-${SEVERITY}-${MNEMONIC}:\s${MESSAGE} -> Record
^${MONTH}\s+${DAY}\s+${TIME}\s*${TIMEZONE}:\s%${FACILITY}-${SEVERITY}-${MNEMONIC}:\s${MESSAGE} -> Record
3 changes: 2 additions & 1 deletion templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ cisco_ios_show_ip_route.textfsm, .*, cisco_ios, sh[[ow]] ip r[[oute]]
cisco_ios_show_aliases.textfsm, .*, cisco_ios, sh[[ow]] alia[[ses]]
cisco_ios_show_archive.textfsm, .*, cisco_ios, sh[[ow]] arc[[hive]]
cisco_ios_show_license.textfsm, .*, cisco_ios, sh[[ow]] lic[[ense]]
cisco_ios_show_logging.textfsm, .*, cisco_ios, sh[[ow]] log[[ging]]
cisco_ios_show_standby.textfsm, .*, cisco_ios, sh[[ow]] sta[[ndby]]
cisco_ios_show_version.textfsm, .*, cisco_ios, sh[[ow]] ver[[sion]]
cisco_ios_show_ip_arp.textfsm, .*, cisco_ios, sh[[ow]] i[[p]] a[[rp]]
Expand Down Expand Up @@ -251,7 +252,7 @@ cisco_wlc_ssh_show_cdp_neighbors_detail.textfsm, .*, cisco_wlc_ssh, sh[[ow]] c[[
cisco_wlc_ssh_show_rf-profile_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] rf-[[profile]] s[[ummary]]
cisco_wlc_ssh_show_ap_config_general.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ap con[[fig]] ge[[neral]]
cisco_wlc_ssh_show_interface_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] int[[erface]] s[[ummary]]
cisco_wlc_ssh_show_client_detail.textfsm, .*, cisco_wlc_ssh, sh[[ow]] cl[[ient]] det[[ail]]
cisco_wlc_ssh_show_client_detail.textfsm, .*, cisco_wlc_ssh, sh[[ow]] cl[[ient]] det[[ail]]
cisco_wlc_ssh_show_exclusionlist.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ex[[clusionlist]]
cisco_wlc_ssh_show_ap_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ap sum[[mary]]
cisco_wlc_ssh_show_inventory.textfsm, .*, cisco_wlc_ssh, sh[[ow]] inve[[ntory]]
Expand Down
3 changes: 3 additions & 0 deletions tests/cisco_ios/show_logging/cisco_ios_show_logging.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Nov 4 15:37:33.641: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/12, changed state to up
afoster213 marked this conversation as resolved.
Show resolved Hide resolved
065478: Dec 4 11:01:38.694 EST: %MAB-5-SUCCESS: Authentication successful for client (aaaa.bbbb.cccc) on Interface Gi8/39
022701: Jun 19 03:02:31: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2/0/3, changed state to down
29 changes: 29 additions & 0 deletions tests/cisco_ios/show_logging/cisco_ios_show_logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
parsed_sample:
- number: ""
month: "Nov"
day: "4"
time: "15:37:33.641"
timezone: ""
facility: "LINK"
severity: "3"
mnemonic: "UPDOWN"
message: "Interface GigabitEthernet1/0/12, changed state to up"
- number: "065478"
month: "Dec"
day: "4"
time: "11:01:38.694"
timezone: "EST"
facility: "MAB"
severity: "5"
mnemonic: "SUCCESS"
message: "Authentication successful for client (aaaa.bbbb.cccc) on Interface Gi8/39"
- number: "022701"
month: "Jun"
day: "19"
time: "03:02:31"
timezone: ""
facility: "LINEPROTO"
severity: "5"
mnemonic: "UPDOWN"
message: "Line protocol on Interface GigabitEthernet2/0/3, changed state to down"