10-20-2023 03:16 PM
Hi all,
I'm trying to change the log severity and a traffic hits an ACL.
I.E the following logging.
%FMANFP-6-IPACCESSLOGDP: F0/0: fman_fp_image: list TEST denied icmp 00be.750d.4e80 1.1.1.2 -> 10.10.10.10 (2048/0), 19 packets
I want to increase from 6 to 4
However, when I try to insert the command. I get an error (see below).
Router#tclsh
Router(tcl)#if { $::facility == "FMANFP" && $::mnemonic == "IPACCESSLOGDP" }
can't read "::facility": no such variable
Router(tcl)#{
+> set incr sev_index [ string first $::mnemonic $::orig_msg ] -2
+> return [string replace $::orig_msg $sev_index $sev_index 4]
+>}
invalid command name "
set incr sev_index [ string first $::mnemonic $::orig_msg ] -2
return [string replace $::orig_msg $sev_index $sev_index 4]
"
set incr sev_index [ string first $::mnemonic $::orig_msg ] -2
retu^rn [string replace $::orig_msg $sev_index $sev_index 4]%
Invalid input detected at '^' marker.
Does anyone know how to do this on IOS-XE 7.9?
Thanks.
11-30-2023 05:16 AM - edited 11-30-2023 05:21 AM
1) I guess you are mixing logging discriminator syntax with tclsh commands
2) IOS-XE 7.9 => should have been 17.9 ?
you may find this helpfull:
System Management Configuration Guide, Cisco IOS XE 17.x - Embedded Syslog Manager (ESM) [Cisco IOS XE 17] - Cisco
section: Example: Severity Escalation
11-30-2023 06:18 AM
I dont know I dont think it easy task
Instead you can use filter to filter all log in that level and only appear the one you want.
MHM
12-01-2023 03:26 PM
Hello,
it looks like you are missing the curly braces for the conditional block ?
Try this syntax (copy and paste the entire line):
if { $::facility == "FMANFP" && $::mnemonic == "IPACCESSLOGDP" } {
set incr sev_index [string first $::mnemonic $::orig_msg] -2
return [string replace $::orig_msg $sev_index $sev_index 4]
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide