Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MikroTik RouterOS 'log print detail without-paging' template (#1514)
- Loading branch information
1 parent
65de0e1
commit 53927d7
Showing
4 changed files
with
111 additions
and
0 deletions.
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
23 changes: 23 additions & 0 deletions
23
ntc_templates/templates/mikrotik_routeros_log_print_detail_without-paging.textfsm
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,23 @@ | ||
Value MONTH (\w{3}) | ||
Value DAY (\d{2}) | ||
Value YEAR (\d{4}) | ||
Value HOUR (\d{2}) | ||
Value MINUTE (\d{2}) | ||
Value SECOND (\d{2}) | ||
Value TOPIC (\S+) | ||
Value MESSAGE (.+) | ||
# Aggregating values | ||
Value DATETIME ((\w{3}/\d{2}(/\d{4})?\s+)?\d{2}:\d{2}:\d{2}) | ||
Value WHOLE_MESSAGE (.+?) | ||
|
||
Start | ||
# Check the general structure to skip all the data that are not log messages | ||
^\s*time=${DATETIME}\s+${WHOLE_MESSAGE}\s*$$ -> LogMessages | ||
|
||
LogMessages | ||
# Here we do more general parsing to get the log messages' time and text as a whole | ||
^\s*time=${DATETIME}\s+${WHOLE_MESSAGE}\s*$$ -> Continue | ||
# and then extract specific values | ||
^\s*time=(${MONTH}/${DAY}(/${YEAR})?\s+)?${HOUR}:${MINUTE}:${SECOND}\s+topics=${TOPIC}\s+message=\"${MESSAGE}\"\s*$$ -> Record | ||
^\s*$$ | ||
^. -> Error |
15 changes: 15 additions & 0 deletions
15
...ros/log_print_detail_without-paging/mikrotik_routeros_log_print_detail_without-paging.raw
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,15 @@ | ||
time=jul/19 14:27:01 topics=script,info message="Ping testA: Packets Sent = 18, Packets Loss = 10 % " | ||
|
||
time=jul/19 16:27:01 topics=script,info message="Ping testA: Packets Sent = 18, Packets Loss = 10 % " | ||
|
||
time=jul/19 16:37:01 topics=script,info message="Ping testA: Packets Sent = 12, Packets Loss = 40 % " | ||
|
||
time=jul/19 19:17:01 topics=script,info message="Ping testA: Packets Sent = 17, Packets Loss = 15 % " | ||
|
||
time=jul/19 03:05:02 topics=script,warning message="Connection via Box bad. Reset USB Modem" | ||
|
||
time=jul/20 03:07:40 topics=interface,info message="lte1 link down" | ||
|
||
time=jul/20 03:07:46 topics=interface,info message="lte1 link up" | ||
|
||
time=jul/20 03:07:46 topics=dhcp,info message="dhcp-client on lte1 got IP address 192.168.1.2" |
72 changes: 72 additions & 0 deletions
72
...ros/log_print_detail_without-paging/mikrotik_routeros_log_print_detail_without-paging.yml
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,72 @@ | ||
--- | ||
parsed_sample: | ||
- month: "jul" | ||
day: "19" | ||
year: "" | ||
hour: "16" | ||
minute: "27" | ||
second: "01" | ||
topic: "script,info" | ||
message: "Ping testA: Packets Sent = 18, Packets Loss = 10 % " | ||
datetime: "jul/19 16:27:01" | ||
whole_message: "topics=script,info message=\"Ping testA: Packets Sent = 18, Packets Loss = 10 % \"" | ||
- month: "jul" | ||
day: "19" | ||
year: "" | ||
hour: "16" | ||
minute: "37" | ||
second: "01" | ||
topic: "script,info" | ||
message: "Ping testA: Packets Sent = 12, Packets Loss = 40 % " | ||
datetime: "jul/19 16:37:01" | ||
whole_message: "topics=script,info message=\"Ping testA: Packets Sent = 12, Packets Loss = 40 % \"" | ||
- month: "jul" | ||
day: "19" | ||
year: "" | ||
hour: "19" | ||
minute: "17" | ||
second: "01" | ||
topic: "script,info" | ||
message: "Ping testA: Packets Sent = 17, Packets Loss = 15 % " | ||
datetime: "jul/19 19:17:01" | ||
whole_message: "topics=script,info message=\"Ping testA: Packets Sent = 17, Packets Loss = 15 % \"" | ||
- month: "jul" | ||
day: "19" | ||
year: "" | ||
hour: "03" | ||
minute: "05" | ||
second: "02" | ||
topic: "script,warning" | ||
message: "Connection via Box bad. Reset USB Modem" | ||
datetime: "jul/19 03:05:02" | ||
whole_message: "topics=script,warning message=\"Connection via Box bad. Reset USB Modem\"" | ||
- month: "jul" | ||
day: "20" | ||
year: "" | ||
hour: "03" | ||
minute: "07" | ||
second: "40" | ||
topic: "interface,info" | ||
message: "lte1 link down" | ||
datetime: "jul/20 03:07:40" | ||
whole_message: "topics=interface,info message=\"lte1 link down\"" | ||
- month: "jul" | ||
day: "20" | ||
year: "" | ||
hour: "03" | ||
minute: "07" | ||
second: "46" | ||
topic: "interface,info" | ||
message: "lte1 link up" | ||
datetime: "jul/20 03:07:46" | ||
whole_message: "topics=interface,info message=\"lte1 link up\"" | ||
- month: "jul" | ||
day: "20" | ||
year: "" | ||
hour: "03" | ||
minute: "07" | ||
second: "46" | ||
topic: "dhcp,info" | ||
message: "dhcp-client on lte1 got IP address 192.168.1.2" | ||
datetime: "jul/20 03:07:46" | ||
whole_message: "topics=dhcp,info message=\"dhcp-client on lte1 got IP address 192.168.1.2\"" |