I'm trying to remember what was the command to create a custom messages and send them to the syslog? It was something like 'log send 5 "bla bla bla"' where 5 is facility which should be used when logging "bla bla bla" message to syslog. I tried to find id in command reference but I couldn't find anything.
Thank you in advance!
Solved! Go to Solution.
You can use EEM to produce your own syslog messages, no log command that I know of to create a syslog on the router CLI and send it, that I know of.
I found this:
I''ve used this command long time ago, but I just can't remember now.
But I cannot find information about IOS version that support it.
Send log XY
Will display on the console the message XY
If you have logging console enabled, then this will send the syslog message XY to the logging server
You can not change the facility though
I'm not quite sure about that. Check this out:
border#send log "To be or not to be"
border#show log | i Console
Console logging: disabled
*Jul 10 01:04:28.510 EEST: %SYS-2-LOGMSG: Message from 322(dpetrov): "To be or not to be"
Even though the console logging is disabled, the log has been successfully sent to the syslog.
I'm 99% sure that I've used command like this to log a few comments as a "history" for my colleagues. In "J" company there is a command like "commit comment 'comment ...'" and I'm sure that I've found an analog for this in Cisco's IOS.
Thank you for your time!
P.s. Nashenec? :)
You are right, even without console logging, send log sends it.
But i dont see how you can change the syslog facility level for send log. It stays as level 2.
As I said, I'm 99% sure that I've found a way to do this. I can't remember now but I've done it :) I even tried to search back in our TACACS+ accounting information to find something - unfortunately without any success.
On the platforms running 12.2(32)SRB and above, there is actually a command : send log
The message will then appear as :
That feature have only been ported to those platforms for now. You can always request an enhancement via TAC or the account team.
Yep, it's exactly what I need/mean.Can you provide me with an url address for this "feature" on your (cisco's) website?
Thank you for your effort and cooperation. I really appreciate it. I won't open a TAC case for now but thanks for the idea too.
Actually, EEM will not allow you to create custom syslog messages. That feature is coming in EEM 3.1. For now, all EEM syslog messages will always have the %HA_EM facility. The Embedded Syslog Manager will allow you to modify messages as they are generated, but you will need to have a message generated first.
There is another option. You can use the "syslog:" file system to create custom messages using tclsh. Messages will be sent using buginf() (i.e. the same way debugging messages are sent). The attached simple tclsh script will allow you to make use of this feature:
tclsh send_syslog.tcl FACILITY SEVERITY MNEMONIC BODY
tclsh flash:/send_syslog.tcl MARCUS 1 XXX "This is a test"