Skip to content

Commit

Permalink
Merge pull request #238 from bittsi/ios_init_down
Browse files Browse the repository at this point in the history
Adapt syslog message format for messages with synchronised clock on IOS
  • Loading branch information
luke-orden committed May 11, 2018
2 parents 5388396 + 9be0462 commit 87b73fc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
8 changes: 4 additions & 4 deletions napalm_logs/config/ios/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ prefixes:
values:
messageId: (\d+)
host: ([^ ]+)
date: (\w+\s?\d+)
date: \*?(\w+\s+\d+)
time: (\d\d:\d\d:\d\d)
milliseconds: (\d\d\d)
tag: ([\w-]+)
# some messages contain a process number (eg. OSPF related messages)
processId: (\d+)
line: '{messageId}: {host}: *{date} {time}.{milliseconds}: %{tag}: Process {processId}, '
line: '{messageId}: {host}: {date} {time}.{milliseconds}: %{tag}: Process {processId}, '
- time_format: "%b %d %H:%M:%S"
values:
messageId: (\d+)
host: ([^ ]+)
date: (\w+\s?\d+)
date: \*?(\w+\s+\d+)
time: (\d\d:\d\d:\d\d)
milliseconds: (\d+)
tag: ([\w-]+)
line: '{messageId}: {host}: *{date} {time}.{milliseconds}: %{tag}: '
line: '{messageId}: {host}: {date} {time}.{milliseconds}: %{tag}: '
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<189>117: NetAuto_CSRv-03: May 9 12:49:27.098: %LINK-5-CHANGED: Interface GigabitEthernet2, changed state to administratively down
33 changes: 33 additions & 0 deletions tests/config/ios/INTERFACE_DOWN/time_synchronized/yang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"yang_message": {
"interfaces": {
"interface": {
"GigabitEthernet2": {
"state": {
"admin_status": "DOWN"
}
}
}
}
},
"message_details": {
"severity": 5,
"facility": 23,
"messageId": "117",
"pri": "189",
"host": "NetAuto_CSRv-03",
"tag": "LINK-5-CHANGED",
"time": "12:49:27",
"date": "May 9",
"message": "Interface GigabitEthernet2, changed state to administratively down",
"milliseconds": "098"
},
"facility": 23,
"ip": "127.0.0.1",
"error": "INTERFACE_DOWN",
"host": "NetAuto_CSRv-03",
"yang_model": "openconfig-interfaces",
"timestamp": 1525870167,
"os": "ios",
"severity": 5
}

0 comments on commit 87b73fc

Please sign in to comment.